#! /bin/sh
#
# inet          Start TCP/IP networking services. This script
#               sets the hostname, creates the routes and
#               starts the Internet Network Daemon & RPC portmapper.
#
# Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#               Various folks at Red Hat
#
# chkconfig: 345 50 50
# description: The internet superserver daemon (commonly called inetd) \
#              starts a variety of other internet services as needed. It \
#              is responsible for starting many services, including telnet, \
#              ftp, rsh, and rlogin. Disabling inetd disables all of the \
#              services it is responsible for.
# processname: inetd
# pidfile: /var/run/inetd.pid
# config: /etc/sysconfig/network
# config: /etc/inetd.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/inetd ] || exit 0

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

	echo
	touch /var/lock/subsys/inet
	;;
  stop)
	# bringing down NFS filesystems isn't inet's problem I don't know 
	# why this script used to do that -- ewt

	echo -n "Stopping INET services: "
	killproc inetd

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

exit 0
