linux下重启tomcat sh

#!/bin/sh

pid=`/sbin/pidofjava`

echo"/sbin/pidofjava"$pid

sleep2

if[-n"$pid"];

then

{

echo"==========tomcatisstart,nowkill$pid============"

kill-9$pid

echo"==kill-9$pid==="

sleep1

exportJAVA_HOME=/usr/java/jdk1.6.0_19

exportCATALINA_HOME=/usr/local/tomcat

cd/usr/local/tomcat/bin

'./startup.sh'

}

else

{

echo"==========tomcatisstop=====start======="

exportJAVA_HOME=/usr/java/jdk1.6.0_19

exportCATALINA_HOME=/usr/local/tomcat

cd/usr/local/tomcat/bin

'./startup.sh'

}

fi

sleep25

echo"dbstar"

相关推荐