removed unused directories and moved bash scripts to root

This commit is contained in:
2016-04-03 08:00:36 -07:00
parent e5ad3b64b0
commit 34bcd602f8
29 changed files with 0 additions and 160 deletions

56
gitbucket.sh Executable file
View File

@@ -0,0 +1,56 @@
#!/bin/bash
GITBUCKETPATH="/home/mollusk/.gitbucket"
WARFILE="gitbucket.war"
LIBNOTIFY="true"
LOGDIR="/tmp"
LOGFILE="gitbucket.log"
CheckNotify()
{
if [ "${LIBNOTIFY}" = "true" ];then
notify-send "$1"
elif [ "${LIBNOTIFY}" = "false" ];then
"$1" &> /dev/null
echo "$(date +"%T"): [INFO]: libnotify support disabled" >> ${LOGDIR}/${LOGFILE}
else
echo "[ATTENTION]: Please check the logs: /tmp/gitbucket.log"
echo "$(date +"%T"): [WARNING]: LIBNOTIFY setting is invalid" >> ${LOGDIR}/${LOGFILE}
fi
}
case "$1" in
start) nohup java -jar ${GITBUCKETPATH}/${WARFILE} &> /dev/null &
sleep 1
PID=$(pidof java)
if [ "${PID}" ];then
CheckNotify "Gitbucket started on PID: ${PID}"
echo "Gitbucket started on PID: ${PID}"
else
CheckNotify "Gitbucket Failed to start!"
echo "Gitbucket process failed to start!"
fi
;;
stop) killall java
sleep 1
if [ ! "${PID}" ];then
CheckNotify "Gitbucket was terminated"
echo "Gitbucket was terminated"
else
CheckNotify "There was a problem terminating Gitbucket"
echo "There was a problem terminating Gitbucket"
fi
;;
open) xdg-open "http://localhost:8080" &> /dev/null
;;
status) ps -fC java
;;
esac