centos7.4——8.运行spring cloud的jar文
centos7.4——运行spring cloud的jar文件相关
#!/bin/sh
name=xxx
path=/mine/app
case "$1" in
start)
#启动
nohup /usr/local/jdk/bin/java -jar $path/$name.jar > /dev/null 2>&1 &
;;
stop)
#停止
ps -ef | grep "$name.jar" | grep -v grep | awk '{print $2}' | xargs kill -9
;;
check)
#检查并执行
count=`ps -ef | grep "$name.jar" | grep -v grep | awk '{print $2}' | wc -l`
if [ $count -lt 1 ]; then
nohup /usr/local/jdk/bin/java -jar $path/$name.jar > /dev/null 2>&1 &
fi
;;
*)
echo 'Please use start or stop or check as first argument'
;;
esac
本文标题:centos7.4——8.运行spring cloud的jar文
本文链接:https://www.haomeiwen.com/subject/owxjhftx.html
网友评论