日期:2014-05-16  浏览次数:20710 次

linux下重启tomcat sh
#!/bin/sh
pid=`/sbin/pidof java`
echo "/sbin/pidof java "$pid

sleep 2

if [ -n "$pid" ];
then
{
echo "==========tomcat is start ,now kill $pid============"
kill -9 $pid
      echo "==kill -9 $pid==="
sleep 1
export JAVA_HOME=/usr/java/jdk1.6.0_19
export CATALINA_HOME=/usr/local/tomcat
cd /usr/local/tomcat/bin
'./startup.sh'
}
else
{
echo "==========tomcat is stop=====start======="
export JAVA_HOME=/usr/java/jdk1.6.0_19
export CATALINA_HOME=/usr/local/tomcat
cd /usr/local/tomcat/bin
        './startup.sh'
}
fi

sleep 25



echo "dbstar"