#!/bin/sh
TOMCAT_PATH=`dirname "$0"` echo "TOMCAT_PATH is /usr/local/tomcat" PID=`ps aux | grep /usr/local/tomcat | grep java | awk '{print $2}'` if [ -n "$PID" ]; then
echo "Will kill tomcat: $PID"
sh "/usr/local/tomcat/bin/shutdown.sh"
sleep
else echo "No Tomcat Process $PID"
fi PID=`ps aux | grep /usr/local/tomcat | grep java | awk '{print $2}'` while [ -n "$PID" ]; do
kill $PID && sleep
echo "Try to kill $PID"
done sh "/usr/local/tomcat/bin/startup.sh"
sleep PID=`ps aux | grep /usr/local/tomcat | grep java | awk '{print $2}'`
if [ -n "$PID" ]; then
echo "\nRestart tomcat successfully!"
else
echo "\nFail to startup tomcat"
exit
fi
/usr/local/tomcat你要替换的内容