James Moger
2012-06-18 67d4f89b0cddb3de05c20e08c20f1bea714c2a9e
commit | author | age
959ad0 1 #!/bin/bash
RL 2 # chkconfig: 3 21 91
cd5825 3 # description: Starts and Stops gitblit
959ad0 4 # Source function library.
RL 5 . /etc/init.d/functions
6
7 # change theses values (default values)
8 GITBLIT_PATH=/opt/gitblit
9 GITBLIT_HTTP_PORT=0
10 GITBLIT_HTTPS_PORT=8443
0e44ac 11 source ${GITBLIT_PATH}/java-proxy-config.sh
MR 12 JAVA="java -server -Xmx1024M ${JAVA_PROXY_CONFIG} -Djava.awt.headless=true -jar"
959ad0 13
RL 14 RETVAL=0
15
16 case "$1" in
17   start)
18     if [ -f $GITBLIT_PATH/gitblit.jar ];
19       then
20       echo $"Starting gitblit server"
a71c5a 21       cd $GITBLIT_PATH
959ad0 22       $JAVA $GITBLIT_PATH/gitblit.jar --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT > /dev/null &
RL 23       echo "."
24       exit $RETVAL
25     fi
26   ;;
27
28   stop)
29     if [ -f $GITBLIT_PATH/gitblit.jar ];
30       then
797bc6 31       echo $"Stopping gitblit server"
a71c5a 32       cd $GITBLIT_PATH
959ad0 33       $JAVA $GITBLIT_PATH/gitblit.jar --stop > /dev/null &
RL 34       echo "."
35       exit $RETVAL
36     fi
37   ;;
38   
39   force-reload|restart)
40       $0 stop
41       $0 start
42   ;;
43
44   *)
45     echo $"Usage: /etc/init.d/gitblit {start|stop|restart|force-reload}"
46     exit 1
47   ;;
48 esac
49
50 exit $RETVAL