启动/关闭Spring boot服务脚本

启动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

  

posted on 2019-05-10 14:26  惊涛随笔  阅读(865)  评论(0编辑  收藏  举报

导航