33 lines
701 B
Bash
Raw Normal View History

#!/bin/bash
GITBUCKETPATH="/home/mollusk/Downloads"
WARFILE="gitbucket.war"
case "$1" in
start) nohup java -jar ${GITBUCKETPATH}/${WARFILE} &> /dev/null &
sleep 1
2016-03-30 21:17:15 -07:00
PID=$(pidof java)
if [ ${PID} ];then
notify-send "Gitbucket started on PID: ${PID}"
echo "Gitbucket started on PID: ${PID}"
2016-03-30 21:17:15 -07:00
else
notify-send "Gitbucket Failed to start!"
2016-03-30 21:17:15 -07:00
echo "Gitbucket process failed to start!"
fi
;;
stop) killall java
2016-03-30 21:17:15 -07:00
if [ ! ${PID} ];then
notify-send "Gitbucket was terminated"
2016-03-30 21:17:15 -07:00
echo "Gitbucket was terminated"
else
notify-send "There was a problem terminating Gitbucket"
2016-03-30 21:17:15 -07:00
echo "There was a problem terminating Gitbucket"
fi
;;
status) ps -fC java
;;
esac