feat: update cmstop.sh

update cmstop.sh to support MacOS
This commit is contained in:
Frank.R.Wu 2021-11-18 19:52:10 +08:00
parent 801c1a93f5
commit 0dd01e574e

View File

@ -1,10 +1,15 @@
#!/bin/bash #!/bin/bash
if [ -a "./PID" ]; then if [ -a "./PID" ]; then
if [ -d '/proc' ]; then
ls /proc/$(cat PID)/cmdline ls /proc/$(cat PID)/cmdline
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
kill -9 $(cat PID) kill -9 $(cat PID)
echo "shutdown old contract manager" echo "shutdown old contract manager"
fi fi
else
kill -9 $(cat PID)
echo "shutdown old contract manager"
fi
rm ./PID rm ./PID
fi fi