0
回答
Linux自动部署Tomcat服务,执行杀进程之后就不执行了,为啥啊?
华为云4核8G,高性能云服务器,免费试用   

#!/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
发帖于1年前 0回/142阅
顶部