#!/bin/sh
# Start/stop the news server.

test -f /usr/sbin/innd || exit 0

case "$1" in
start)
	echo "Starting news server: innd"
	start-stop-daemon --quiet --start --user root \
		--pidfile /var/run/innd/innd.pid --startas /etc/news/boot |
		sed -e '/Starting innd./d' -e 's/^/innd: boot: /' &
	sleep 2
	;;
stop)
	echo "Stopping news server: innd"
	if [ -f /var/run/innd/innwatch.pid ]
	then
		start-stop-daemon --quiet --stop \
			--pidfile /var/run/innd/innwatch.pid
	fi
	start-stop-daemon --quiet --stop \
		--pidfile /var/run/innd/innd.pid --exec /usr/sbin/innd
	;;
*)	echo "Usage: /etc/init.d/inn start|stop"; exit 1 ;;
esac

exit 0
