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
posted @ 2021-08-11 15:52  小傻孩丶儿  阅读(154)  评论(3编辑  收藏  举报