NWho -- rwho/rwhod replacement
-Copyright (c) 1996--2001 Martin Mares <mj@ucw.cz>
+Copyright (c) 1996--2010 Martin Mares <mj@ucw.cz>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program in the file /usr/doc/copyright/GPL. If not,
-write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
-MA 02139, USA.
+A full copy of the GNU GPL can be found in /usr/share/common-licenses on
+Debian systems.
--- /dev/null
+# If you want to send your nwho information to another server, set
+# its name here. If you want to gather information from the others,
+# leave it commented out.
+
+#NWHOSERVER=server.name
--- /dev/null
+#!/bin/sh
+# Start/stop the nwho daemon.
+
+### BEGIN INIT INFO
+# Provides: nwho
+# Required-Start: $network $local_fs
+# Required-Stop: $network $local_fs
+# Default-Start: S 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