启动Java的jar包
#!/bin/bash
#启动后台测试服务
nohup java -jar rgs-system-1.0.0-SNAPSHOT.jar --spring.config.location=./application-test.yml &
#指定一个文件接收pid
echo $!> Task.pid
echo "write the pid into Task.pid"
关闭Java服务
#!/bin/bash
#读取指定文件,并kill掉pid
kill -9 $(cat Task.pid)
echo "end the rgs-system-1.0.0-SNAPSHOT now"