码迷,mamicode.com
首页 > 编程语言 > 详细

脚本启动SpringBoot(jar)

时间:2019-09-09 19:09:50      阅读:93      评论:0      收藏:0      [点我收藏+]

标签:files   app   top   awk   active   roc   not   print   pid   

#!/bin/sh RESOURCE_NAME=springbsit-api.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 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=test & echo $! > tpid echo Start Success!

脚本启动SpringBoot(jar)

标签:files   app   top   awk   active   roc   not   print   pid   

原文地址:https://www.cnblogs.com/123hll/p/11493427.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!