#! /bin/sh
#
# loopback      This script is the very first step in setting up
#               network related stuff; it sets up the loopback
#               interface.
#
# Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#               Modified for RHS Linux by Damien Neil
#

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

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

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

# See how we were called.
case "$1" in
  start)
	# Set up loopback interface.
	echo -n "Setting up loopback interface... "
	ifconfig lo 127.0.0.1
	route add 127.0.0.1
	echo "done."
	touch /var/lock/subsys/loopback
	;;
  stop)
	# Shut down loopback.
	echo -n "Shutting down loopback interface... "
	ifconfig lo down
	echo
	rm -f /var/lock/subsys/loopback
	;;
  *)
	echo "Usage: loopback {start|stop}"
	exit 1
esac

exit 0
