#!/bin/sh
#
# livecd-net-eth
# Try to autoconfigure ethernet interfaces
#
# chkconfig: 345 07 95
# description:	aimed at livecd use
### BEGIN INIT INFO
# Required-Start: $local-fs udevd-final
# Should-Start:
# Required-Stop:
# Short-Description: Try to autoconfigure ethernet interfaces
# Description: Try to autoconfigure ethernet interfaces
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
### END INIT INFO

# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1

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

LOCKFILE=/run/lock/subsys/livecd-net-eth
RETVAL=0

start()
{
	echo -n "Configuring network: "
	/usr/libexec/livecd-net-eth || return 1
	return 0
}

# See how we were called.
case "$1" in
	start|restart|reload)
		start || RETVAL=1
		;;
	stop)
		;;
	condstop)
		;;
	condrestart|condreload)
		if [ -e "$LOCKFILE" ]; then
			start || RETVAL=1
		fi
		;;
	status)
		;;
	*)
		msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
		RETVAL=1
esac

exit $RETVAL
