重启Tomcat脚本

PID=`ps aux | grep $1 | grep -v grep | grep -v $0 | awk ‘{print $2}’`
export JAVA_HOME=/usr/lib/jvm/jdk7
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
if [ -z $PID ];then
sh $1/bin/startup.sh
if [ $? -eq 0 ];then
echo “tomcat start success”
else

echo “tomcat start failed”
fi
else
kill -9 $PID
sh $1/bin/startup.sh
if [ $? -eq 0 ];then
echo “tomcat start success”
else

echo “tomcat start failed”
fi
fi

发表评论

电子邮件地址不会被公开。 必填项已用*标注