#!/bin/sh -e
#
# nntpcache	Startup script for the NNTPCACHE server.
#
#		Modified for nntpcache
#		by Herbert Xu <herbert@debian.org>
#		Written by Miquel van Smoorenburg <miquels@cistron.nl>.
#		Modified for Debian GNU/Linux
#		by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# Version:	$Id: init,v 1.3 1998/05/06 22:36:08 herbert Exp $

DAEMON=/usr/sbin/nntpcached
NAME=nntpcache
DESC="NNTPCACHE server"

test -f $DAEMON || exit 0

case "$1" in
start)
	echo -n "Starting $DESC: "
	start-stop-daemon --start --quiet --exec $DAEMON
	echo "$NAME."
	;;
stop)
	echo -n "Stopping $DESC: "
	start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
	echo "$NAME."
	;;
reload | force-reload)
	echo "Reloading $DESC configuration files."
	start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON
	;;
restart)
	echo -n "Restarting $DESC: "
	start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
	sleep 1
	start-stop-daemon --start --quiet --exec $DAEMON
	echo "$NAME."
	;;
*)
	N=/etc/init.d/$NAME
	echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
	exit 1
	;;
esac

exit 0
