From d82001bbeeae6d74c092a6d08be5bffaa6879096 Mon Sep 17 00:00:00 2001 From: pan <1029559041@qq.com> Date: Sun, 11 Oct 2020 00:11:31 +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 | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/shell/updateRisk b/shell/updateRisk index e2b9181..c381032 100644 --- a/shell/updateRisk +++ b/shell/updateRisk @@ -1,6 +1,21 @@ #!/bin/sh #自动部署脚本 +#如果当前存在自动部署进程,除当前进程以外其他直接kill掉 +if [ `ls -l *.pid|wc -l` -gt 0 ] +then + for file in *.pid + do + pid=`cat $file` + kill -9 $pid + if [ $? -eq 0 ] + then + echo "成功杀死进程:$pid" + rm -f $file + fi + done +fi + echo $$>$1.pid cd /app @@ -24,21 +39,6 @@ function run(){ fi } -#如果当前存在自动部署进程直接kill掉 -if [ `ls -l *.pid|wc -l` -gt 0 ] -then - for file in *.pid - do - pid=`cat $file` - kill -9 $pid - if [ $? -eq 0 ] - then - echo "成功杀死进程:$pid" - rm -f $file - fi - done -fi - run $1 rm -f $1.pid