| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 | #!/bin/sh######################################################################### Begin /sbin/ifup## Description : Interface Up## Authors     : Nathan Coulson - nathan@linuxfromscratch.org#               Kevin P. Fleming - kpfleming@linuxfromscratch.org# Update      : Bruce Dubbs - bdubbs@linuxfromscratch.org## Version     : LFS 7.0## Notes       : The IFCONFIG variable is passed to the SERVICE script#               in the /lib/boot directory, to indicate what file the#               service should source to get environmental variables.#########################################################################file=/etc/sysconfig/ifconfig.${1}# Skip backup files[ "${file}" = "${file%""~""}" ] || exit 0. /lib/boot/functionsboot_mesg "Bringing up the ${1} interface..."boot_mesg_flushif [ ! -r "${file}" ]; then   boot_mesg "${file} is missing or cannot be accessed." ${WARNING}   echo_warning   exit 1fi. $fileif [ "$IFACE" = "" ]; then   boot_mesg "${file} does not define an interface [IFACE]." ${FAILURE}   echo_failure   exit 1fi# Do not process this service if started by boot, and ONBOOT# is not set to yesif [ "${IN_BOOT}" = "1" -a "${ONBOOT}" != "yes" ]; then   echo_skipped   exit 0fiif [ -n "${SERVICE}" -a -x "/lib/boot/${SERVICE}" ]; then   if [ -z "${CHECK_LINK}"         -o \           "${CHECK_LINK}" = "y"   -o \           "${CHECK_LINK}" = "yes" -o \           "${CHECK_LINK}" = "1" ]; then      #  Bring up the interface      if ip link show ${IFACE} > /dev/null 2>&1; then         link_status=`ip link show ${IFACE}`         if [ -n "${link_status}" ]; then            if ! echo "${link_status}" | grep -q UP; then               ip link set ${IFACE} up            fi         fi      else         boot_mesg "Interface ${IFACE} doesn't exist." ${WARNING}         echo_warning      fi   fi   IFCONFIG=${file} /lib/boot/${SERVICE} ${IFACE} upelse   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   exit 1fi# End /sbin/ifup
 |