wok-6.x view git/stuff/git-daemon @ rev 24977

created recipe for fslint-lang
author Hans-G?nter Theisgen
date Fri May 06 16:54:42 2022 +0100 (2022-05-06)
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