0
回答
Linux自动部署Tomcat服务,执行杀进程之后就不执行了,为啥啊?
滴滴云服务器,限时包月0.9元,为开发者而生>>>   

#!/bin/bash

echo  'start deploy cb.....'

echo 'aaaaaa' |   sudo -S  /opt/zkbc/cb-prj/bin/shutdown.sh

for pid in $(ps -ef | grep cb | grep -v grep | awk '{print $2}');
do
    echo $pid
   echo 'aaaaaa' | sudo -S  kill -9 $pid
done


echo "open cb-prj-->webapps and delete files..."
cd /opt/zkbc/cb-prj/webapps
echo 'aaaaaa' | sudo -S rm -rf ./*

echo "copy tmp--->webapps and rename....."
echo 'aaaaaa' | sudo -S cp /tmp/cb-prj.war /opt/zkbc/cb-prj/webapps
echo 'aaaaaa' | sudo -S mv  cb-prj.war  ROOT.war


echo "start tomcat service ......"
sh  /opt/zkbc/cb-prj/bin/run.sh

echo "echo logs ...."
tail -100f /opt/zkbc/cb-prj/logs/catalina.out
 

举报
双人鱼XKQ
发帖于10个月前 0回/134阅
顶部