#!/bin/sh #停止java项目 echo "--------Stop java--------" pid=`ps -ef | grep zjzdd-app-1.0-SNAPSHOT.jar | grep -v grep |awk '{print $2}'` if [ $pid ]; then echo :App is running pid=$pid kill -9 $pid fi echo "--------Stop java End--------" #启动java项目 echo "--------Start java--------" nohup java -jar zjzdd-app-1.0-SNAPSHOT.jar --spring.profiles.active=prod & tail -f nohup.out