adding all of botlist, initial add
[botlist.git] / botlist_misc / git / git-daemon-init
bloba84a2a0920f72983634d6abe68bb80a373205e2e
1 #!/bin/sh
2 #
3 #################################################
4 # git-daemon-init This shell script takes care of starting and stopping
5 #
6 # On ubuntu:
7 # To acknowledge this RC.d script:
8 # sudo update-rc.d git-daemon-init defaults
10 # Tested with ubuntu 7.10
11 # Date: 3/28/2008
12 #################################################
14 . /lib/lsb/init-functions
16 BASE_PATH=/var/www/projects/git
17 GIT_REPO_PATH=${BASE_PATH}/ghostnet.git
18 DAEMON="/usr/local/bin/git-daemon -- --reuseaddr --detach --verbose --base-path=${BASE_PATH} --export-all ${GIT_REPO_PATH}"
19 PIDFILE=/var/run/git-daemon-init.pid
20 NAME=git-daemon-init
22 case "$1" in
23 start)
24 # Start daemon.
25 log_daemon_msg "Starting git daemon: " "$NAME"
26 start-stop-daemon --start --quiet --pidfile "$PIDFILE" --name "$NAME" --exec $DAEMON
27 log_end_msg $?
29 stop)
30 # Stop daemon.
31 log_daemon_msg "Stopping git daemon: " "$NAME"
32 start-stop-daemon --stop --quiet --pidfile "$PIDFILE" --name "$NAME"
33 log_end_msg $?
35 restart)
36 # Restarting daemon.
37 log_daemon_msg "Restarting git daemon: " "$NAME"
38 start-stop-daemon --stop --retry 5 --quiet --pidfile "$PIDFILE" --name "$NAME"
39 start-stop-daemon --start --quiet --pidfile "$PIDFILE" --name "$NAME" --exec $DAEMON
40 log_end_msg $?
43 log_action_msg "Usage: /etc/init.d/git-daemon-init {start|stop|restart}"
44 exit 2
46 esac
48 exit $RETVAL
50 # End of script