#! /bin/sh
### BEGIN INIT INFO
# Provides:          nws
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
### END INIT INFO
#
# skeleton	example file to build /etc/init.d/ scripts.
#		This file should be used to construct scripts for /etc/init.d.
#
#		Written by Miquel van Smoorenburg <miquels@cistron.nl>.
#		Modified for Debian GNU/Linux
#		by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# Version:	@(#)skeleton  1.8  03-Mar-1998  miquels@cistron.nl
#
# This file was automatically customized by dh-make on Sat, 30 Sep 2000 16:41:16 +0200
# Modified for nws by Martin Quinson. It was easy, I've done a big script 
#  which designed to be here at the begining, but it's now too big :
#  a separate conf file, a few hundred lines...
#  So, the present file is now a wrapper to this file, renamed nws_setup.

PATH=/sbin:/bin:/usr/sbin:/usr/bin

# This file is conffile. So, it can stay in place after package desinstallation,
#  but that's not a reason to break around. ;)
test -f /usr/bin/nws_setup || exit 0

# Quit without error when the package is not configured
test -s /etc/nws.conf || exit 0

set -e

case "$1" in
  start|reload|force-reload)
    /usr/bin/nws_setup -c /etc/nws.conf $1
	;;
  stop)
    /usr/bin/nws_setup -c /etc/nws.conf term
	;;
  restart)
    /usr/bin/nws_setup -c /etc/nws.conf term
    sleep 1
    /usr/bin/nws_setup -c /etc/nws.conf start
	;;
  *)
	echo "Usage: /etc/init.d/`basename $0` {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0
