Last active
April 14, 2017 09:12
-
-
Save lhcpig/a3813a6dcdd8546b2581905d6bb29775 to your computer and use it in GitHub Desktop.
jenkins 部署spring-boot应用
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
nohup /usr/bin/java -jar $1 >> $2 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
pid=`/usr/sbin/lsof -i:$1 | grep java | awk '{print $2}'` | |
if test -z "$pid" | |
then | |
echo 'api has not been started' | |
echo 'skip kill it' | |
else | |
echo "kill $pid" | |
kill -9 $pid | |
sleep 5 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment