linux下tomcat快速启动
#!/bin/sh
tomcatpath=/qn/sys_tomcat
case $1 in
stop)
cd $tomcatpath/bin
./shutdown.sh
sleep 3
# SER=`netstat -nlp | grep :9090 | awk '{print $7}'|cut -d'/' -f1`
SER=`ps -ef|grep /qn/sys_tomcat|grep -v grep|awk '{print $2}'|cut -d'/' -f1`
echo $SER
kill -9 $SER
echo "tomcat stop"
;;
start)
cd /qn/servers
cp -f qq.war $tomcatpath/webapps
cd $tomcatpath/webapps
rm -rf qq
cd $tomcatpath/bin
./startup.sh
echo "sleet start"
sleep 3
echo "sleep end"
cp -r /qn/qqlib/ $tomcatpath/webapps/qq/WEB-INF/lib
SER=`ps -ef|grep /qn/sys_tomcat|grep -v grep|awk '{print $2}'|cut -d'/' -f1`
echo $SER
kill -9 $SER
nohup ./startup.sh &
;;
restart)
cd $tomcatpath/bin
./shutdown.sh
sleep 3
# SER=`netstat -nlp | grep :9090 | awk '{print $7}'|cut -d'/' -f1`
SER=`ps -ef|grep /qn/sys_tomcat|grep -v grep|awk '{print $2}'|cut -d'/' -f1`
echo $SER
kill -9 $SER
nohup ./startup.sh &
;;
*)
echo error param
;;
esac