]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - debian/zephyr-clients.init
rules *.docs: attempt to install documentation
[1ts-debian.git] / debian / zephyr-clients.init
1 #! /bin/sh
2 #
3 # skeleton      example file to build /etc/init.d/ scripts.
4 #               This file should be used to construct scripts for /etc/init.d.
5 #
6 #               Written by Miquel van Smoorenburg <miquels@cistron.nl>.
7 #               Modified for Debian GNU/Linux
8 #               by Ian Murdock <imurdock@gnu.ai.mit.edu>.
9 #
10 # Version:      @(#)skeleton  1.8  03-Mar-1998  miquels@cistron.nl
11 #
12 # This file was automatically customized by dh-make on Mon,  4 Dec 2000 05:28:22 -0500
13
14 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
15 DAEMON=/usr/sbin/zhm
16 NAME=zhm
17 DESC="zephyr host manager"
18
19 test -f $DAEMON || exit 0
20
21 set -e
22
23 if test -f /etc/default/zephyr-clients
24 then
25         . /etc/default/zephyr-clients
26 fi
27
28 case "$1" in
29   start)
30         # note that the following will need revisting when we get hesiod support
31         if test -z "$zhm_args"
32         then
33                 cat <<EOF
34 The zephyr-clients package for whatever reason does not have any zephyr
35 servers configured. Please edit the file /etc/default/zephyr-clients and
36 add the names of your zephyr servers, seperated by spaces, to the
37 zhm_args variable.
38 EOF
39                 exit 0
40         fi
41         echo -n "Starting $DESC: "
42         start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
43                 --exec $DAEMON -- $zhm_args
44         echo "$NAME."
45         ;;
46   stop)
47         echo -n "Stopping $DESC: "
48         start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/$NAME.pid \
49                 --exec $DAEMON
50         echo "$NAME."
51         ;;
52   restart|force-reload)
53         #
54         #       If the "reload" option is implemented, move the "force-reload"
55         #       option to the "reload" entry above. If not, "force-reload" is
56         #       just the same as "restart".
57         #
58         echo -n "Restarting $DESC: "
59         start-stop-daemon --oknodo --stop --quiet --pidfile \
60                 /var/run/$NAME.pid --exec $DAEMON
61         sleep 1
62         start-stop-daemon --start --quiet --pidfile \
63                 /var/run/$NAME.pid --exec $DAEMON -- $zhm_args
64         echo "$NAME."
65         ;;
66   *)
67         N=/etc/init.d/$NAME
68         # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
69         echo "Usage: $N {start|stop|restart|force-reload}" >&2
70         exit 1
71         ;;
72 esac
73
74 exit 0