系统相关
首页 > 系统相关> > 常用Shell脚本集锦

常用Shell脚本集锦

作者:互联网

微服务jar的启动脚本

#!/bin/sh

appname=springboot-notify-starter.jar

pid=`ps -ef|grep -v grep|grep ${appname}|awk '{print $2}'`

echo $pid -----stop-------

if [[ v$pid!=v ]]

then

echo will stop....

kill -9 $pid

sleep 3

echo springboot-notify-starter stoped....

fi

nohup java -jar ${appname} --spring.profiles.active=prod  --server.port=8080 >/dev/null 2>&1 &

sleep 3

echo springboot-notify-starter start......

sleep 3

tailf /java/springboot/consumer/application.log

标签:脚本,Shell,springboot,appname,jar,pid,echo,notify,集锦
来源: https://blog.csdn.net/weixin_42246822/article/details/115360478