#! /bin/bash
#
if [ -z `pidof java` ]; then
echo -e `date +%Y-%m-%d` `date +%R`. “33[31m33[1m(JAVA)Process does not exist! 33[0m” >> /data/logs/java_check.log
/usr/local/tomcat/bin/startup.sh >/dev/null 2>1
sleep 30
netstat -tnlp >> /data/logs/java_check.log
echo -e “r” >> /data/logs/java_check.log
fi
#!/bin/sh
export J_LIB=/data/sms/lib;
export CLASSPATH=.:$J_LIB/jtds-1.2.jar:$J_LIB/log4j-1.2.12.jar:$J_LIB/postgresql-8.1-404.jdbc3.jar;
export JAVA_HOME=/usr/java/jdk1.5.0_05
export JRE=/usr/local/jdk/jre
export SHELL=/bin/bash
export HOME=/data/sms
#java check status
if /bin/ps ax | /bin/grep -v grep | /bin/grep "java XinTai"; then
cd;
else
cd /data/sms/xintai;
/usr/java/jdk1.5.0_05/bin/java XinTai >/dev/null
fi