diff --git a/shell/killNode b/shell/killNode index d7eda0d..0009f4d 100644 --- a/shell/killNode +++ b/shell/killNode @@ -1,13 +1,21 @@ #!/bin/sh #杀死进程 +result=1 if [ -e run.pid ] then p=`cat run.pid` - kill -9 $p + kill $p if [ $? -eq 0 ] then echo "成功杀死进程:$p" rm -f run.pid + else + echo "无法杀死进程:$p" + result=0 fi fi -./run.sh + +if [ $result -eq 1 ] +then + ./run.sh +fi