啓動/關閉Spring boot服務腳本

啓動Spring boot服務腳本java

#!/bin/bash
cd /test
java -jar test.jar &> ./test.log & 
echo "成功"

關閉Spring boot服務腳本bash

#!/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
相關文章
相關標籤/搜索