附shell源码
#!/bin/bash
export BUILD_ID=dontkillme #必须加
TOMCATTHREAD=`ps aux | grep 'tomcat_user' | grep -v grep`
if test -z "$TOMCATTHREAD"
then
echo "TOMCAT NOT START"
else
THREADLIST=(${TOMCATTHREAD// / })
PID=${THREADLIST[1]}
kill -9 $PID
sleep 3s
fi
cd /home/formax/tomcat/tomcat_user/webapps
rm -f userapi.war
rm -rf userapi
cd /home/formax/tomcat/tomcat_user/bin
startup.sh
sleep 5s