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条)