From 9ad8b6251d1e0b9b4e51f523c23620413be69463 Mon Sep 17 00:00:00 2001 From: pan <1029559041@qq.com> Date: Sun, 11 Oct 2020 00:29:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0openresty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/updateRisk | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/shell/updateRisk b/shell/updateRisk index 3395cb6..273143c 100644 --- a/shell/updateRisk +++ b/shell/updateRisk @@ -2,18 +2,14 @@ #自动部署脚本 #如果当前存在自动部署进程直接kill掉 -if [ `find -maxdepth 1 -name "*.pid"|wc -l` -gt 0 ] +if [ -e $1.pid ] then - for file in *.pid - do - pid=`cat $file` - kill -9 $pid - if [ $? -eq 0 ] - then - echo "成功杀死进程:$pid" - rm -f $file - fi - done + kill -9 `cat $1.pid` + if [ $? -eq 0 ] + then + echo "成功杀死进程:$pid" + rm -f $file + fi fi echo $$>$1.pid