Explorar o código

update stop script

rainbow954 %!s(int64=7) %!d(string=hai) anos
pai
achega
db7c102795
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  1. 9 1
      src/bin/stop.sh

+ 9 - 1
src/bin/stop.sh

@@ -1,2 +1,10 @@
 #!/bin/bash
-kill  `ps -ef|grep data-acceptance.jar| grep -v grep| awk '{print $2}'`
+PID=`ps -ef|grep data-acceptance.jar| grep -v grep| awk '{print $2}'`
+
+if [!-f ${PID})];then
+  echo "进程不存在"
+else
+  kill  $PID
+  echo "正在关闭进程"
+  sleep 5
+fi