Merge branch 'master' of https://git.maemo.org/projects/udhcp
[udhcp] / debian / udhcpd
1 #! /bin/sh
2 ### BEGIN INIT INFO
3 # Provides:          udhcpd
4 # Required-Start:    $remote_fs $syslog
5 # Required-Stop:     $remote_fs $syslog
6 # Default-Start:     2 3 4 5
7 # Default-Stop:      0 1 6
8 ### END INIT INFO
9 #
10 # skeleton      example file to build /etc/init.d/ scripts.
11 #               This file should be used to construct scripts for /etc/init.d.
12 #
13 #               Written by Miquel van Smoorenburg <miquels@cistron.nl>.
14 #               Modified for Debian GNU/Linux
15 #               by Ian Murdock <imurdock@gnu.ai.mit.edu>.
16 #
17 # Version:      @(#)skeleton  1.9  26-Feb-2001  miquels@cistron.nl
18 #
19
20 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
21 DAEMON=/usr/sbin/udhcpd
22 NAME=udhcpd
23 DESC="very small DHCP server"
24
25 test -x $DAEMON || exit 0
26
27 set -e
28
29 case "$1" in
30   start)
31         echo -n "Starting $DESC: "
32         start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
33                 --exec $DAEMON
34         echo "$NAME."
35         ;;
36   stop)
37         echo -n "Stopping $DESC: "
38         start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
39                 --exec $DAEMON
40         echo "$NAME."
41         ;;
42   #reload)
43         #
44         #       If the daemon can reload its config files on the fly
45         #       for example by sending it SIGHUP, do it here.
46         #
47         #       If the daemon responds to changes in its config file
48         #       directly anyway, make this a do-nothing entry.
49         #
50         # echo "Reloading $DESC configuration files."
51         # start-stop-daemon --stop --signal 1 --quiet --pidfile \
52         #       /var/run/$NAME.pid --exec $DAEMON
53   #;;
54   restart|force-reload)
55         #
56         #       If the "reload" option is implemented, move the "force-reload"
57         #       option to the "reload" entry above. If not, "force-reload" is
58         #       just the same as "restart".
59         #
60         echo -n "Restarting $DESC: "
61         start-stop-daemon --stop --quiet --pidfile \
62                 /var/run/$NAME.pid --exec $DAEMON
63         sleep 1
64         start-stop-daemon --start --quiet --pidfile \
65                 /var/run/$NAME.pid --exec $DAEMON
66         echo "$NAME."
67         ;;
68   *)
69         N=/etc/init.d/$NAME
70         # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
71         echo "Usage: $N {start|stop|restart|force-reload}" >&2
72         exit 1
73         ;;
74 esac
75
76 exit 0