#autoRestart.sh#author:Kind#!/bin/shTOMCAT_HOME=/usl/local/apache-tomcat-6.0.45pid=`ps aux | grep tomcat | grep -v grep | grep -v retomcat | awk '{print $2}'`if [ -n "$pid" ]then{ echo ---shutdown tomcat--- $TOMCAT_HOME/bin/shutdown.sh sleep 2 pid=`ps aux | grep tomcat | grep -v grep | grep -v retomcat | awk '{print $2}'` if [ -n "$pid" ] then { sleep 2 echo ---kill tomcat begin--- kill -9 $pid echo ---kill tomcat end--- } fi sleep 2 echo 1---startup tomcat--- $TOMCAT_HOME/bin/startup.sh}elseecho 2---startup tomcat---$TOMCAT_HOME/bin/startup.shfi