wok view git/stuff/git-daemon @ rev 25204
updated python-mock (1.0.1 -> 3.0.5)
author | Hans-G?nter Theisgen |
---|---|
date | Wed Jul 13 14:28:15 2022 +0100 (2022-07-13) |
parents | 7f188676b59c |
children |
line source
1 #!/bin/sh
2 # /etc/init.d/git-daemon: Start, stop and restart git daemon on SliTaz,
3 # at boot time or with the command line.
4 #
5 # To start git daemon at boot time, just put git-daemon in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=git-daemon
12 DESC="$(_ '%s daemon' Git)"
13 DAEMON=/usr/lib/git-core/git-daemon
14 OPTIONS=$GIT_OPTIONS
15 PIDFILE=/var/run/git-daemon.pid
17 case "$1" in
18 (start)
19 if active_pidfile $PIDFILE $NAME
20 then
21 _ '%s is already running.' $NAME
22 exit 1
23 fi
24 action 'Starting %s: %s...' "$DESC" $NAME
25 $DAEMON --pid-file=$PIDFILE $OPTIONS
26 status
27 ;;
28 (stop)
29 if ! active_pidfile $PIDFILE $NAME
30 then
31 _ '%s is not running.' $NAME
32 exit 1
33 fi
34 action 'Stopping %s: %s...' "$DESC" $NAME
35 kill $(cat $PIDFILE)
36 status
37 ;;
38 (restart)
39 if ! active_pidfile $PIDFILE $NAME
40 then
41 _ '%s is not running.' $NAME
42 exit 1
43 fi
44 action 'Restarting %s: %s...' "$DESC" $NAME
45 kill $(cat $PIDFILE)
46 sleep 2
47 $DAEMON --pid-file=$PIDFILE $OPTIONS
48 status
49 ;;
50 (*)
51 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
52 newline
53 exit 1
54 ;;
55 esac
57 exit 0