Jenkins执行shell重启tomcat
附shell源码 #!/bin/bashexport BUILD_ID=dontkillme #必须加TOMCATTHREAD=`ps aux | grep 'tomcat_user' | grep -v grep`if test -z "$TOMCATTHREAD"thenecho "TOMCAT NOT START"elseTHREADLIST=(${TOM
·
附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
更多推荐
已为社区贡献2条内容
所有评论(0)