sh

sh

sh

启动springboot的jar程序

#!/bin/sh

RESOURCE_NAME=beautify-0.0.2-SNAPSHOT.jartpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`if [ ${tpid} ]; thenecho 'Stop Process...'kill -15 $tpidfisleep 5tpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`if [ ${tpid} ]; thenecho 'Kill Process!'kill -9 $tpidelseecho 'Stop Success!'fitpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`if [ ${tpid} ]; thenecho 'App is running.'elseecho 'App is NOT running.'firm -f tpidnohup java -jar ./$RESOURCE_NAME --spring.profiles.active=test &echo $! > tpidecho Start Success!
复制代码

停止springboot的jar程序

#!/bin/sh

RESOURCE_NAME=beautify-0.0.2-SNAPSHOT.jartpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`if [ ${tpid} ]; thenecho 'Stop Process...'kill -15 $tpidfisleep 5tpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`if [ ${tpid} ]; thenecho 'Kill Process!'kill -9 $tpidelseecho 'Stop Success!'fi
复制代码

转载于:

发布者:admin,转转请注明出处:http://www.yc00.com/news/1687432178a9570.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信