added checks and messages for PID

This commit is contained in:
silvernode 2016-03-30 21:17:15 -07:00
parent a3bd344ad7
commit 1ba4bf672d

View File

@ -3,7 +3,19 @@
case "$1" in
start) nohup java -jar /home/mollusk/Downloads/gitbucket.war &> /dev/null &
PID=$(pidof java)
if [ ${PID} ];then
echo "Gitbucket started on pid ${PID}"
else
echo "Gitbucket process failed to start!"
fi
;;
stop) killall java
if [ ! ${PID} ];then
echo "Gitbucket was terminated"
else
echo "There was a problem terminating Gitbucket"
fi
;;
esac