附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

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐