【7.2.5】更新一个启动Guns的脚本

pull/20/head
fengshuonan 2022-10-18 20:33:07 +08:00
parent df6c651590
commit b4ef62b157
1 changed files with 14 additions and 0 deletions

14
bash/start-guns.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/sh
echo " =====关闭Guns应用======"
PROCESS=`ps -ef | grep java | grep -v grep | grep guns.jar | awk '{print $2}'`
for i in $PROCESS
do
echo "Kill the $1 process [ $i ]"
kill -9 $i
done
echo " =====启动Java应用======"
nohup java -Xms1024M -Xmx1024M -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=512M -jar guns.jar --spring.profiles.active=local > guns.out &
echo $! > guns-pid.txt
cat guns-pid.txt
rm guns-pid.txt
tail -f guns.out