linux 启动和停止脚本

授权

chmod 777 文件名

java -jar net-0.0.1-SNAPSHOT.war --spring.profiles.active=local


sp_pid=`ps -ef | grep net-0.0.1-SNAPSHOT.war | grep -v grep | awk '{print $2}'`

if [ -z "$sp_pid" ];

then

 echo "[ not find net-0.0.1-SNAPSHOT.war pid ]"

else

 echo "find result: $sp_pid "

 kill -9 $sp_pid

fi
不会,我可以学;落后,我可以追赶;跌倒,我可以站起来!
原文地址:https://www.cnblogs.com/xiaoshahai/p/15128616.html