#! /bin/sh
#
# news          Start the INN server.
#
# Author:       David Myers <dem@skyline.rtp.nc.us>
#

# Source function library.
. /etc/rc.d/init.d/functions

# Get config.
. /etc/sysconfig/network

# Check that networking is up.
# Pretty much need it for INN.
if [ ${NETWORKING} = "no" ]
then
	exit 0
fi

[ -f /etc/rc.d/rc.news ] || exit 0

# See how we were called.
case "$1" in
  start)
	echo -n "Starting news service: "
	su news -c /etc/rc.d/rc.news > /dev/null&
	echo innd
	touch /var/lock/subsys/news
	;;
  stop)
	echo -n "Stopping news service: "
	/usr/lib/news/bin/ctlinnd throttle "Shutting down" > /dev/null
	sleep 1
	/usr/lib/news/bin/ctlinnd shutdown "Shutting down" > /dev/null
	echo innd
	rm -f /var/lock/subsys/news
	;;
  *)
	echo "Usage: news {start|stop}"
	exit 1
esac

exit 0
