From 8e94958f4f24d1c5409d25a929615554e0f2f4c8 Mon Sep 17 00:00:00 2001 From: silvernode Date: Wed, 30 Mar 2016 21:38:22 -0700 Subject: [PATCH] added libnotify messages for start and stop messages --- Bash Scripts/gitbucket.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Bash Scripts/gitbucket.sh b/Bash Scripts/gitbucket.sh index 77a99e4..8f80005 100755 --- a/Bash Scripts/gitbucket.sh +++ b/Bash Scripts/gitbucket.sh @@ -1,21 +1,32 @@ #!/bin/bash +GITBUCKETPATH="/home/mollusk/Downloads" +WARFILE="gitbucket.war" case "$1" in - start) nohup java -jar /home/mollusk/Downloads/gitbucket.war &> /dev/null & + start) nohup java -jar ${GITBUCKETPATH}/${WARFILE} &> /dev/null & + sleep 1 PID=$(pidof java) if [ ${PID} ];then - echo "Gitbucket started on pid ${PID}" + notify-send "Gitbucket started on PID: ${PID}" + echo "Gitbucket started on PID: ${PID}" else + notify-send "Gitbucket Failed to start!" echo "Gitbucket process failed to start!" fi ;; stop) killall java if [ ! ${PID} ];then + notify-send "Gitbucket was terminated" echo "Gitbucket was terminated" else + notify-send "There was a problem terminating Gitbucket" echo "There was a problem terminating Gitbucket" fi + + ;; + + status) ps -fC java ;; esac