wok-current view ddclient/stuff/ddclient @ rev 4737
knock/knockd-helper: add help
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Jan 07 12:40:20 2010 +0100 (2010-01-07) |
parents | |
children | 7f188676b59c |
line source
1 #!/bin/sh
2 # /etc/init.d/ddclient: Start, stop and restart Slim deamon 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="ddclient 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 echo "$NAME already running."
20 exit 1
21 fi
22 echo -n "Starting $DESC: $NAME... "
23 $DAEMON $OPTION
24 status
25 ;;
26 stop)
27 if ! active_pidfile $PID_FILE ddclient ; then
28 echo "$NAME is not running."
29 exit 1
30 fi
31 echo -n "Stopping $DESC: $NAME... "
32 killall ddclient
33 rm $PID_FILE
34 status
35 ;;
36 restart)
37 if ! active_pidfile $PID_FILE ddclient ; then
38 echo "$NAME is not running."
39 exit 1
40 fi
41 echo -n "Restarting $DESC: $NAME... "
42 killall ddclient
43 rm $PID_FILE
44 sleep 2
45 $DAEMON $OPTION
46 status
47 ;;
48 *)
49 echo ""
50 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
51 echo ""
52 exit 1
53 ;;
54 esac
56 exit 0