summaryrefslogtreecommitdiffstats
path: root/distrib/gitblit-ubuntu
blob: b047ed97804af01de6f6856c6affb142e157687c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# chkconfig: 3 21 91
# Source function library.
. /lib/init/vars.sh
. /lib/lsb/init-functions

PATH=/sbin:/bin:/usr/bin:/usr/sbin

# change theses values (default values)
GITBLIT_PATH=/opt/gitblit
GITBLIT_USER="gitblit"
source ${GITBLIT_PATH}/java-proxy-config.sh
ARGS="-server -Xmx1024M ${JAVA_PROXY_CONFIG} -Djava.awt.headless=true -jar gitblit.jar"

RETVAL=0

case "$1" in
  start)
    if [ -f $GITBLIT_PATH/gitblit.jar ];
      then
      echo $"Starting gitblit server"
      start-stop-daemon --start --quiet --background --oknodo --make-pidfile --pidfile /var/run/gitblit.pid --exec /usr/bin/java --chuid $GITBLIT_USER --chdir $GITBLIT_PATH -- $ARGS
      exit $RETVAL
    fi
  ;;

  stop)
    if [ -f $GITBLIT_PATH/gitblit.jar ];
      then
      echo $"Stopping gitblit server"
      start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/gitblit.pid
      exit $RETVAL
    fi
  ;;
  
  force-reload|restart)
      $0 stop
      $0 start
  ;;

  *)
    echo $"Usage: /etc/init.d/gitblit {start|stop|restart|force-reload}"
    exit 1
  ;;
esac

exit $RETVAL