#!/bin/sh
#
# chkconfig: 345 95 25
# description:  This shell script takes care of starting and \
#               stopping dnews.
#
# processname: dnews
# config: /etc/dnews.conf
# pidfile: /var/run/dnews.pid

. /etc/rc.d/init.d/functions
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -d /etc/dnews ] || exit 0
[ -d /usr/lib/dnews ] || exit 0
[ -d /var/spool/dnews ] || exit

# See how we were called.
case "$1" in
  start)
	# Start daemons.
	echo -n "Starting dnews: "
	daemon /usr/lib/dnews/dnews_start
	echo
	touch /var/lock/subsys/dnews
	;;
  stop)
	# Stop daemons.
	echo -n "Shutting down dnews: "
	killproc dnews
	echo
	rm -f /var/lock/subsys/dnews
	;;
  status)
	status dnews
	;;
  reload)
	echo -n "Restarting dnews: "
	/usr/bin/tellnews reload
	echo
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
        echo "Usage: dnews.init {start|stop|status|reload|restart}"
        exit 1
esac

exit 0
