reload-jar.sh
#!/bin/bash cd /data/energy/jar/ echo "change dir success" sleep 2s curl -X POST "http://127.0.0.1:12315/restartactuator/shutdown" printf "\nstop success" sleep 2s echo "start jar" FILENAME=`ls /data/energy/jar/energy-* -t |head -n1|awk '{print $0}'` nohup java -jar $FILENAME --spring.profiles.active=prod > /dev/null 2>&1 & echo "jar run success"