From 0dd01e574e35a1c310bcf277e85fc70636043e1d Mon Sep 17 00:00:00 2001 From: "Frank.R.Wu" Date: Thu, 18 Nov 2021 19:52:10 +0800 Subject: [PATCH] feat: update cmstop.sh update cmstop.sh to support MacOS --- script/cmstop.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/script/cmstop.sh b/script/cmstop.sh index bf0b5e5..56b5cd9 100755 --- a/script/cmstop.sh +++ b/script/cmstop.sh @@ -1,8 +1,13 @@ #!/bin/bash if [ -a "./PID" ]; then - ls /proc/$(cat PID)/cmdline - if [ $? -eq 0 ]; then + if [ -d '/proc' ]; then + ls /proc/$(cat PID)/cmdline + if [ $? -eq 0 ]; then + kill -9 $(cat PID) + echo "shutdown old contract manager" + fi + else kill -9 $(cat PID) echo "shutdown old contract manager" fi