启动Spring boot服务脚本
#!/bin/bash
cd /test
java -jar test.jar &> ./test.log &
echo "成功"
关闭Spring boot服务脚本
#!/bin/bash
APP_NAME="test.jar"
echo "stop SpringBoot Application"
pid=`ps -ef | grep $APP_NAME | grep -v grep | awk '{print $2}'`
if [ -n "$pid" ]
then
kill -9 $pid
fi