重启tomcat的shell脚本

发布时间:2016-07-31 21:55:07 编辑:javaEE 阅读:(764次)

      


export LANG=zh_CN.UTF-8
cd /root/tomcat/bin
a=$(ps -ef |grep tomcat |grep -v grep |awk '{print $2}')
if [ "$a" == "" ]
then
echo "service is stop"
else
b=$(ps -ef|grep tomcat|grep -v grep|awk '{print $2}')
if [ "$b" != "" ]
then 
kill -9 $b
echo "stoping......."
sleep 1
fi
fi

sh startup.sh;