echo "开始重新启动tomcat逻辑...."
tomcatPid=`ps -ef | grep tomcat | grep -v grep | awk '{print $2}'`
if [ $tomcatPid ]; then
echo 'tomcat 的进程id为:'$tomcatPid
kill -9 $tomcatPid
sleep 10s
else
echo "tomcat没有启动,重新进行启动"
fi
#启动tomcat
tomcatPid=`ps -ef | grep tomcat | grep -v grep | awk '{print $2}'`
if [ $tomcatPid ]; then
echo 'tomcat 的进程id为:'$tomcatPid
kill -9 $tomcatPid
sleep 10s
else
echo "tomcat没有启动,重新进行启动"
fi
#启动tomcat
/opt/soft/apache-tomcat-7.0.68/bin/startup.sh