wok diff dhid/stuff/init.d/dhid @ rev 18897

syslinux/isohybrid.exe add -r support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 14 22:06:06 2016 +0100 (2016-02-14)
parents
children 7f188676b59c
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dhid/stuff/init.d/dhid	Sun Feb 14 22:06:06 2016 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +#!/bin/sh
     1.5 +#
     1.6 +# /etc/init.d/dhid: Start, stop and restart dhis daemon on SliTaz
     1.7 +#
     1.8 +. /lib/libtaz.sh
     1.9 +#. /etc/daemons.conf
    1.10 +
    1.11 +NAME=DHID
    1.12 +DESC="dyn ip"
    1.13 +DAEMON=/usr/sbin/dhid
    1.14 +PIDFILE=/run/dhid.pid
    1.15 +OPTIONS="-P $PIDFILE"
    1.16 +
    1.17 +case "$1" in
    1.18 +		start)
    1.19 +		if active_pidfile $PIDFILE dhid; then
    1.20 +			echo "$NAME already running."; §exit 1
    1.21 +		fi
    1.22 +		echo -n "Starting $DESC: $NAME... "
    1.23 +		$DAEMON $OPTIONS 
    1.24 +		status ;;
    1.25 +	
    1.26 +	stop)
    1.27 +		if ! active_pidfile $PIDFILE dhid; then
    1.28 +			echo "$NAME is not running."; exit 1
    1.29 +		fi
    1.30 +		echo -n "Stopping $DESC: $NAME... "
    1.31 +		kill $(cat $PIDFILE)
    1.32 +		rm $PIDFILE
    1.33 +		status ;;
    1.34 +	
    1.35 +	restart)
    1.36 +		if ! active_pidfile $PIDFILE dhid; then
    1.37 +			echo "$NAME is not running."; exit 1
    1.38 +		fi
    1.39 +		echo -n "Restarting $DESC: $NAME... "
    1.40 +		kill $(cat $PIDFILE)
    1.41 +		rm $PIDFILE
    1.42 +		sleep 2
    1.43 +		$DAEMON $OPTIONS
    1.44 +		status ;;
    1.45 +	
    1.46 +	*) 
    1.47 +		echo "Usage: /etc/init.d/$(basename $0) [start|stop|restart]"
    1.48 +		exit 1 ;;
    1.49 +esac
    1.50 +
    1.51 +exit 0