常用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
上一篇:阿里云直播之获取推流地址和播放地址


下一篇:新来的领导下令升级 MySQL 8.0,完美掉坑…