]> mj.ucw.cz Git - nwho.git/blob - debian/nwho.init
Debian: Fixed Default-Start
[nwho.git] / debian / nwho.init
1 #!/bin/sh
2 # Start/stop the nwho daemon.
3
4 ### BEGIN INIT INFO
5 # Provides:          nwho
6 # Required-Start:    $network $local_fs
7 # Required-Stop:     $network $local_fs
8 # Default-Start:     2 3 4 5
9 # Default-Stop:      0 1 6
10 # Short-Description: The network who daemon
11 # Description:       This is Yet Another RWho Replacement utility. It collects information
12 #                    about all logged in users on a central server where it can be displayed.
13 ### END INIT INFO
14
15 test -f /usr/sbin/nwhod || exit 0
16
17 if [ -f /etc/default/nwho ] ; then
18         . /etc/default/nwho
19 fi
20
21 case "$1" in
22 start)  echo -n "Starting network who daemon: nwhod"
23         start-stop-daemon --start --quiet --exec /usr/sbin/nwhod $NWHOSERVER
24         echo "."
25         ;;
26 stop)   echo -n "Stopping network who daemon: nwhod"
27         start-stop-daemon --stop --quiet --exec /usr/sbin/nwhod
28         [ -z "$NWHOSERVER" ] && rm -f /var/state/nwho/*
29         echo "."
30         ;;
31 restart|reload|force-reload) echo -n "Restarting network who daemon: nwhod"
32         start-stop-daemon --stop --quiet --exec /usr/sbin/nwhod
33         start-stop-daemon --start --quiet --exec /usr/sbin/nwhod $NWHOSERVER
34         echo "."
35         ;;
36 *)      echo "Usage: /etc/init.d/nwho start|stop|restart|reload|force-reload"
37         exit 1
38         ;;
39 esac
40 exit 0