#!/bin/sh RESOURCE_NAME=GTWork.jar tpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'` if [ ${tpid} ]; then echo 'Stop Process...' kill -15 $tpid fi sleep 5 tpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'` if [ ${tpid} ]; then echo 'Kill Process!' kill -9 $tpid else echo 'Stop Success!' fi sleep 2 tpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'` if [ ${tpid} ]; then echo 'App is running.' else echo 'App is NOT running.' fi rm -f tpid # nohup java -jar ./$RESOURCE_NAME --spring.profiles.active=prod & nohup /usr/local/java/jdk1.8.0_171/bin/java -Dfile.encoding=utf-8 -jar GTWork.jar -spring.profiles.active=dev -server.port=7889 -spring.redis.host=127.0.0.1 -spring.redis.password=123 & echo $! > tpid
相关文章
关键词:
发表评论