Created
February 1, 2016 09:49
-
-
Save didyhu/542db824d9fbbb308db0 to your computer and use it in GitHub Desktop.
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/bash | |
TARGET=PATHTOTHEJARORWAR.war | |
start(){ | |
(java -jar $TARGET &) | |
} | |
stop(){ | |
PID=$(status | awk '{ print $2 }') | |
if [ -z "$PID" ] | |
then | |
echo "Application is already stopped" | |
else | |
echo "killing: $PID" | |
kill $PID | |
fi | |
} | |
status(){ | |
ps -ef | grep "$TARGET" | grep -v grep | |
} | |
case "$1" in | |
start) start ;; | |
stop) stop ;; | |
restart) | |
stop | |
start | |
;; | |
status) status ;; | |
*) echo "usage: $0 start|stop|restart" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment