wok-next view dhid/stuff/init.d/dhid @ rev 18465

libQtDBus: add /usr/bin/qdbus
author Xander Ziiryanoff <psychomaniak@xakep.ru>
date Fri Oct 02 13:31:38 2015 +0200 (2015-10-02)
parents
children 7f188676b59c
line source
1 #!/bin/sh
2 #
3 # /etc/init.d/dhid: Start, stop and restart dhis daemon on SliTaz
4 #
5 . /lib/libtaz.sh
6 #. /etc/daemons.conf
8 NAME=DHID
9 DESC="dyn ip"
10 DAEMON=/usr/sbin/dhid
11 PIDFILE=/run/dhid.pid
12 OPTIONS="-P $PIDFILE"
14 case "$1" in
15 start)
16 if active_pidfile $PIDFILE dhid; then
17 echo "$NAME already running."; §exit 1
18 fi
19 echo -n "Starting $DESC: $NAME... "
20 $DAEMON $OPTIONS
21 status ;;
23 stop)
24 if ! active_pidfile $PIDFILE dhid; then
25 echo "$NAME is not running."; exit 1
26 fi
27 echo -n "Stopping $DESC: $NAME... "
28 kill $(cat $PIDFILE)
29 rm $PIDFILE
30 status ;;
32 restart)
33 if ! active_pidfile $PIDFILE dhid; then
34 echo "$NAME is not running."; exit 1
35 fi
36 echo -n "Restarting $DESC: $NAME... "
37 kill $(cat $PIDFILE)
38 rm $PIDFILE
39 sleep 2
40 $DAEMON $OPTIONS
41 status ;;
43 *)
44 echo "Usage: /etc/init.d/$(basename $0) [start|stop|restart]"
45 exit 1 ;;
46 esac
48 exit 0