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
版权声明:本文标题:sh 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/jishu/1686529483h6410.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论