Explorar el Código

更新 oss-store shutdown 脚本

reghao hace 1 año
padre
commit
43b126280f
Se han modificado 1 ficheros con 10 adiciones y 3 borrados
  1. 10 3
      oss-store/bin/shutdown.sh

+ 10 - 3
oss-store/bin/shutdown.sh

@@ -1,5 +1,12 @@
 #!/bin/bash
 
-app='oss-store.jar'
-pid=`jps | grep ${app} | awk '{print $1}'`
-kill -15 ${pid}
+app_name='oss-store.jar'
+pid=`ps -ef | grep ${app_name} | grep -v grep | awk '{print $2}'`
+if [[ -z ${pid} ]];
+then
+  echo ${app_name}" killed"
+else
+  echo "kill "${app_name}" with pid "${pid}
+  kill -15 ${pid}
+fi
+