#!/bin/sh
#
# sendfiled	- starts and stops the sendfile daemon
#
# chkconfig:	2345 80 20
# description:	Starts and stops the sendfile spool daemon 
# config:	/etc/sendfile.cf
# config:	/etc/sendfile.allow
# config:	/etc/sendfile.deny
# config:	/etc/sendfile.aliases

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

# Source networking configuration.
. /etc/sysconfig/network

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

[ -f /usr/sbin/sendfiled ] || exit 0

# See how we were called.
case "$1" in
	start)
		# Start daemon.
		echo -n "Starting sendfiled: "
		daemon sendfiled -Q
		echo
		;;
	stop)
		# Stop daemon.
		echo -n "Shutting down sendfiled: "
		killproc sendfiled
		echo
		;;
	status)
		status sendfiled
		;;
	restart|reload)
		$0 stop
		$0 start
		;;

	*)
		echo "Usage: sendfiled {start|stop|status|restart|reload}"
		exit 1
esac

exit 0
