#!/bin/sh
### BEGIN INIT INFO
# Provides:            localnet
# Required-Start:      cmdline
# Should-Start:
# Required-Stop:
# Should-Stop:
# Default-Start:       3 4 5
# Default-Stop:
# Short-Description:   Starts the local network.
# Description:         Sets the hostname of the machine and starts the
#                      loopback interface.
# X-LFS-Provided-By:   LFS
### END INIT INFO

. /etc/init.d/template

lo()
{
	ip addr $1 127.0.0.1/8 label lo dev lo
	ip link set lo $2
}

start() {
	action_shell 'Starting lo interface:' lo add up
	touch "$LOCKFILE"
}

stop() {
	action_shell 'Stopping lo interface:' lo del down
	rm -f "$LOCKFILE"
}

switch "${1-}"
