admin 管理员组

文章数量: 887021

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
复制代码

转载于:

本文标签: sh