wok annotate ddclient/stuff/ddclient @ rev 20654

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