| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 | #!/bin/sh######################################################################### Begin $network_devices/ifup## Description : Interface Up## Authors     : Nathan Coulson - nathan@linuxfromscratch.org#               Kevin P. Fleming - kpfleming@linuxfromscratch.org## Version     : 00.00## Notes       : the IFCONFIG variable is passed to the scripts found#               in the services directory, to indicate what file the#               service should source to get environmental variables.#########################################################################. /etc/sysconfig/rc . ${rc_functions} # Collect a list of configuration files for our interfaceif [ -n "${2}" ]; then	for file in ${@#$1} # All parameters except $1  do		FILES="${FILES} ${network_devices}/ifconfig.${1}/${file}"	doneelif [ -d "${network_devices}/ifconfig.${1}" ]; then	FILES=`echo ${network_devices}/ifconfig.${1}/*`else 	FILES="${network_devices}/ifconfig.${1}"fiboot_mesg "Bringing up the ${1} interface..."boot_mesg_flush# Process each configruation filefor file in ${FILES}; do	# skip backup files	if [ "${file}" != "${file%""~""}" ]; then		continue	fi	if [ ! -f "${file}" ]; then		boot_mesg "${file} is not a network configuration file or directory." ${WARNING}		echo_warning		continue	fi	(		. ${file}		# Will not process this service if started by boot, and ONBOOT		# is not set to yes		if [ "${IN_BOOT}" = "1" -a "${ONBOOT}" != "yes" ]; then			continue		fi		# Will not process this service if started by hotplug, and 		# ONHOTPLUG is not set to yes		if [ "${IN_HOTPLUG}" = "1" -a "${ONHOTPLUG}" != "yes" \                    -a "${HOSTNAME}" != "(none)" ]; then continue		fi		if [ -n "${SERVICE}" -a -x "${network_devices}/services/${SERVICE}" ]; then			if [ -z "${CHECK_LINK}" -o "${CHECK_LINK}" = "y" \                            -o "${CHECK_LINK}" = "yes" -o "${CHECK_LINK}" = "1" ]; then				if ip link show ${1} > /dev/null 2>&1; then					link_status=`ip link show ${1}`					if [ -n "${link_status}" ]; then						if ! echo "${link_status}" | grep -q UP; then							ip link set ${1} up						fi					fi				else					boot_mesg "Interface ${1} doesn't exist." ${WARNING}					echo_warning					continue				fi			fi			IFCONFIG=${file} ${network_devices}/services/${SERVICE} ${1} up		else			boot_mesg "Unable to process ${file}.  Either" ${FAILURE}			boot_mesg " the SERVICE variable was not set,"			boot_mesg " or the specified service cannot be executed."			echo_failure			continue		fi	)done# End $network_devices/ifup
 |