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