springboot shell启动脚本

#!/bin/sh

port=8099
pid=`lsof -i:$port |grep -v "PID" |awk '{print $2}'`

if [  -n  "$pid"  ];then
    echo "------pid=$pid is running, stop process------"
   
    kill -9 $pid;
	
    echo "-------------------port has stopped----------"
	
    nohup java -jar ../device-people-server-1.0.0.jar >>../nohup.out 2>&1 &

    echo "-------------------start success-------------"

else
    nohup java -jar ../device-people-server-1.0.0.jar >>../nohup.out 2>&1 &

    echo "-------------------start success-------------"

fi


标题:springboot shell启动脚本
作者:Ulrica
地址:http://www.oceanworld.top/articles/2021/06/24/1624516107312.html

avatar

取消