updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / gitblit / gitblit.rc.d
blob2ec0d35a8a23a58ab77a9751d876a37148977dff
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 DAEMON=gitblit
8 GITBLIT_LOG=/var/log/gitblit/gitblit.log
9 GITBLIT_USER=gitblit
10 GITBLIT_JAVA_OPTS="-server -Xmx1024M"
11 GITBLIT_START_ARGS=""
12 GITBLIT_STOP_ARGS="--stop"
14 [ -r /etc/profile.d/jdk.sh ] && . /etc/profile.d/jdk.sh
15 [ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
17 case "$1" in
18 start)
19 stat_busy "Starting $DAEMON"
20 if ck_daemon $DAEMON; then
21 su -s '/bin/sh' $GITBLIT_USER -c "cd && $JAVA_HOME/bin/java $GITBLIT_JAVA_ARGS -jar gitblit.jar $GITBLIT_START_ARGS 2>&1 >>$GITBLIT_LOG" &>/dev/null &
22 add_daemon $DAEMON
23 stat_done
24 else
25 stat_fail
26 exit 1
29 stop)
30 stat_busy "Stopping $DAEMON"
31 if ! ck_daemon $DAEMON; then
32 su -s '/bin/sh' $GITBLIT_USER -c "cd && $JAVA_HOME/bin/java $GITBLIT_JAVA_ARGS -jar gitblit.jar $GITBLIT_STOP_ARGS" &>/dev/null
33 rm_daemon $DAEMON
34 stat_done
35 else
36 stat_fail
37 exit 1
40 restart)
41 $0 stop
42 sleep 1
43 $0 start
46 echo "usage: $0 {start|stop|restart}"
47 esac