#! /bin/sh
#
# chkconfig: 345 50 50
# description: rlinetd is a powerful replacement for inetd.
#              rlinetd is a connection manager which binds and
#              listens to a number of ports, and performs
#              specified actions when a connection is made. It
#              is intended as a replacement for the BSD inetd program.
# processname: rlinetd
# pidfile: /var/run/rlinetd.pid
# config: /etc/sysconfig/network
# config: /etc/rlinetd.conf


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

# Get config.
. /etc/sysconfig/network

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

[ -f /usr/sbin/rlinetd ] || exit 0
[ -f /etc/rlinetd.conf ] || exit 0

# See how we were called.
case "$1" in
  start)
	echo -n "Starting rlinetd: "
	daemon rlinetd

	echo
	touch /var/lock/subsys/rlinetd
	;;
  stop)
	echo -n "Stopping rlinetd: "
	killproc rlinetd

	echo
	rm -f /var/lock/subsys/rlinetd
	;;
  status)
	status rlinetd
	;;
  reload)
	killall -HUP rlinetd
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: rlinetd {start|stop|status|restart|reload}"
	exit 1
esac

exit 0
