wok-current view ddclient/stuff/ddclient @ rev 24056
Up zstd (1.5.0)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Jun 08 09:29:15 2021 +0000 (2021-06-08) |
parents | 7f188676b59c |
children |
line source
1 #!/bin/sh
2 # /etc/init.d/ddclient: Start, stop and restart Slim daemon on SliTaz, at boot
3 # time or with the command line.
4 #
5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/ddclient.conf.
7 #
8 . /etc/init.d/rc.functions
10 NAME=DDclient
11 DESC="$(_ 'dynamic IP manager')"
12 DAEMON=/usr/sbin/ddclient
13 PID_FILE=/var/run/ddclient.pid
14 OPTION="-pid $PID_FILE"
16 case "$1" in
17 start)
18 if active_pidfile $PID_FILE ddclient ; then
19 _ '%s is already running.' $NAME
20 exit 1
21 fi
22 action 'Starting %s: %s...' "$DESC" $NAME
23 $DAEMON $OPTION
24 status
25 ;;
26 stop)
27 if ! active_pidfile $PID_FILE ddclient ; then
28 _ '%s is not running.' $NAME
29 exit 1
30 fi
31 action 'Stopping %s: %s...' "$DESC" $NAME
32 killall ddclient
33 rm $PID_FILE
34 status
35 ;;
36 restart)
37 if ! active_pidfile $PID_FILE ddclient ; then
38 _ '%s is not running.' $NAME
39 exit 1
40 fi
41 action 'Restarting %s: %s...' "$DESC" $NAME
42 killall ddclient
43 rm $PID_FILE
44 sleep 2
45 $DAEMON $OPTION
46 status
47 ;;
48 *)
49 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
50 newline
51 exit 1
52 ;;
53 esac
55 exit 0