From 4d05771a4fcba89b5725ce4f865e016b988b1869 Mon Sep 17 00:00:00 2001 From: pan <1029559041@qq.com> Date: Sun, 11 Oct 2020 07:02:57 +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/killNode | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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