wok annotate git/stuff/git-daemon @ rev 12065
fix gtk-engine-nodoka bdeps & genpkg_rules
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Fri Mar 09 02:01:06 2012 +0100 (2012-03-09) |
parents | d4bb4d4d8235 |
children | 7f188676b59c |
rev | line source |
---|---|
slaxemulator@11682 | 1 #!/bin/sh |
slaxemulator@11682 | 2 # /etc/init.d/git-daemon: Start, stop and restart git-daemon daemon on SliTaz, at boot |
slaxemulator@11682 | 3 # time or with the command line. |
slaxemulator@11682 | 4 # |
slaxemulator@11682 | 5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS |
slaxemulator@11682 | 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf. |
slaxemulator@11682 | 7 # |
slaxemulator@11682 | 8 . /etc/init.d/rc.functions |
slaxemulator@11682 | 9 . /etc/daemons.conf |
slaxemulator@11682 | 10 |
slaxemulator@11682 | 11 NAME=git-daemon |
slaxemulator@11682 | 12 DESC="git-daemon daemon" |
slaxemulator@11682 | 13 DAEMON=/usr/lib/git-core/git-daemon |
slaxemulator@11682 | 14 OPTIONS=$GIT_OPTIONS |
slaxemulator@11682 | 15 PIDFILE=/var/run/git-daemon.pid |
slaxemulator@11682 | 16 |
slaxemulator@11682 | 17 case "$1" in |
slaxemulator@11682 | 18 start) |
pascal@11686 | 19 if active_pidfile $PIDFILE git-daemon ; then |
slaxemulator@11682 | 20 echo "$NAME already running." |
slaxemulator@11682 | 21 exit 1 |
slaxemulator@11682 | 22 fi |
slaxemulator@11682 | 23 echo -n "Starting $DESC: $NAME... " |
slaxemulator@11682 | 24 $DAEMON --pid-file=$PIDFILE $OPTIONS |
slaxemulator@11682 | 25 status |
slaxemulator@11682 | 26 ;; |
slaxemulator@11682 | 27 stop) |
pascal@11686 | 28 if ! active_pidfile $PIDFILE git-daemon ; then |
slaxemulator@11682 | 29 echo "$NAME is not running." |
slaxemulator@11682 | 30 exit 1 |
slaxemulator@11682 | 31 fi |
slaxemulator@11682 | 32 echo -n "Stopping $DESC: $NAME... " |
slaxemulator@11682 | 33 kill `cat $PIDFILE` |
slaxemulator@11682 | 34 status |
slaxemulator@11682 | 35 ;; |
slaxemulator@11682 | 36 restart) |
pascal@11686 | 37 if ! active_pidfile $PIDFILE git-daemon ; then |
slaxemulator@11682 | 38 echo "$NAME is not running." |
slaxemulator@11682 | 39 exit 1 |
slaxemulator@11682 | 40 fi |
slaxemulator@11682 | 41 echo -n "Restarting $DESC: $NAME... " |
slaxemulator@11682 | 42 kill `cat $PIDFILE` |
slaxemulator@11682 | 43 sleep 2 |
slaxemulator@11682 | 44 $DAEMON $OPTIONS |
slaxemulator@11682 | 45 status |
slaxemulator@11682 | 46 ;; |
slaxemulator@11682 | 47 *) |
slaxemulator@11682 | 48 echo "" |
slaxemulator@11682 | 49 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" |
slaxemulator@11682 | 50 echo "" |
slaxemulator@11682 | 51 exit 1 |
slaxemulator@11682 | 52 ;; |
slaxemulator@11682 | 53 esac |
slaxemulator@11682 | 54 |
slaxemulator@11682 | 55 exit 0 |