#!/bin/sh # Start/stop the nwho daemon. ### BEGIN INIT INFO # Provides: nwho # Required-Start: $network $local_fs # Required-Stop: $network $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: The network who daemon # Description: This is Yet Another RWho Replacement utility. It collects information # about all logged in users on a central server where it can be displayed. ### END INIT INFO test -f /usr/sbin/nwhod || exit 0 if [ -f /etc/default/nwho ] ; then . /etc/default/nwho fi case "$1" in start) echo -n "Starting network who daemon: nwhod" start-stop-daemon --start --quiet --exec /usr/sbin/nwhod $NWHOSERVER echo "." ;; stop) echo -n "Stopping network who daemon: nwhod" start-stop-daemon --stop --quiet --exec /usr/sbin/nwhod [ -z "$NWHOSERVER" ] && rm -f /var/state/nwho/* echo "." ;; restart|reload|force-reload) echo -n "Restarting network who daemon: nwhod" start-stop-daemon --stop --quiet --exec /usr/sbin/nwhod start-stop-daemon --start --quiet --exec /usr/sbin/nwhod $NWHOSERVER echo "." ;; *) echo "Usage: /etc/init.d/nwho start|stop|restart|reload|force-reload" exit 1 ;; esac exit 0