wok-6.x rev 4564
Add ddclient (stuff)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Dec 06 12:23:33 2009 +0100 (2009-12-06) |
parents | 2f36aef61933 |
children | 449135e8deae |
files | ddclient/stuff/ddclient |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ddclient/stuff/ddclient Sun Dec 06 12:23:33 2009 +0100 1.3 @@ -0,0 +1,56 @@ 1.4 +#!/bin/sh 1.5 +# /etc/init.d/ddclient: Start, stop and restart Slim deamon on SliTaz, at boot 1.6 +# time or with the command line. 1.7 +# 1.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS 1.9 +# variable of /etc/rcS.conf and configure options with /etc/ddclient.conf. 1.10 +# 1.11 +. /etc/init.d/rc.functions 1.12 + 1.13 +NAME=DDclient 1.14 +DESC="ddclient dynamic IP manager" 1.15 +DAEMON=/usr/sbin/ddclient 1.16 +PID_FILE=/var/run/ddclient.pid 1.17 +OPTION="-pid $PID_FILE" 1.18 + 1.19 +case "$1" in 1.20 + start) 1.21 + if active_pidfile $PID_FILE ddclient ; then 1.22 + echo "$NAME already running." 1.23 + exit 1 1.24 + fi 1.25 + echo -n "Starting $DESC: $NAME... " 1.26 + $DAEMON $OPTION 1.27 + status 1.28 + ;; 1.29 + stop) 1.30 + if ! active_pidfile $PID_FILE ddclient ; then 1.31 + echo "$NAME is not running." 1.32 + exit 1 1.33 + fi 1.34 + echo -n "Stopping $DESC: $NAME... " 1.35 + killall ddclient 1.36 + rm $PID_FILE 1.37 + status 1.38 + ;; 1.39 + restart) 1.40 + if ! active_pidfile $PID_FILE ddclient ; then 1.41 + echo "$NAME is not running." 1.42 + exit 1 1.43 + fi 1.44 + echo -n "Restarting $DESC: $NAME... " 1.45 + killall ddclient 1.46 + rm $PID_FILE 1.47 + sleep 2 1.48 + $DAEMON $OPTION 1.49 + status 1.50 + ;; 1.51 + *) 1.52 + echo "" 1.53 + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" 1.54 + echo "" 1.55 + exit 1 1.56 + ;; 1.57 +esac 1.58 + 1.59 +exit 0