Browse Source

青涩知夏->增加启动脚本

青涩知夏 4 years ago
parent
commit
304459005a
1 changed files with 39 additions and 0 deletions
  1. 39 0
      nosum-gateway.sh

+ 39 - 0
nosum-gateway.sh

@@ -0,0 +1,39 @@
+#! /bin/sh   
+start(){  
+ exec java -Dnosum-gateway -jar nosum-gateway-v1-jar-with-dependencies.jar -XX:+UseG1GC >> /dev/null 2>&1 &
+ exec ps -ef | grep nosum-gateway | grep -v "grep"
+}  
+stop(){  
+  ps -ef | grep nosum-gateway| grep -v "grep" | cut -c 9-15 | xargs kill -9
+}
+
+status(){  
+ ps -ef | grep nosum-gateway | grep -v "grep"
+}
+
+logs(){  
+ tailf logs/nosum-gateway.log
+}    
+  
+case "$1" in  
+start)  
+start  
+;;  
+stop)  
+stop  
+;; 
+status)  
+status  
+;;
+logs)  
+logs  
+;;       
+restart)  
+stop  
+start  
+;;  
+*)  
+printf 'Usage: %s {start|stop|restart|status|logs}\n' "$prog"  
+exit 1  
+;;  
+esac