linux下启动/停止springboot项目脚本

startup.sh

nohup java -jar xxx.jar > logs/catalina.out 2>&1 &

shutdown.sh

PID=$(ps -ef | grep xxx.jar | grep -v grep | awk '{ print KaTeX parse error: Expected 'EOF', got '}' at position 3: 2 }̲') if [ -z "PID" ]
then
echo Application is already stopped
else
echo kill $PID
kill $PID
fi

你可能感兴趣的:(java,java)