2 ########################################################################
5 # Description : Interface Up
7 # Authors : Nathan Coulson - nathan@linuxfromscratch.org
8 # Kevin P. Fleming - kpfleming@linuxfromscratch.org
9 # Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
13 # Notes : The IFCONFIG variable is passed to the SERVICE script
14 # in the /lib/boot directory, to indicate what file the
15 # service should source to get environmental variables.
17 ########################################################################
19 file=/etc
/sysconfig
/ifconfig.
${1}
22 [ "${file}" = "${file%""~""}" ] ||
exit 0
26 boot_mesg
"Bringing up the ${1} interface..."
29 if [ ! -r "${file}" ]; then
30 boot_mesg
"${file} is missing or cannot be accessed." ${WARNING}
37 if [ "$IFACE" = "" ]; then
38 boot_mesg
"${file} does not define an interface [IFACE]." ${FAILURE}
43 # Do not process this service if started by boot, and ONBOOT
45 if [ "${IN_BOOT}" = "1" -a "${ONBOOT}" != "yes" ]; then
50 if [ -n "${SERVICE}" -a -x "/lib/boot/${SERVICE}" ]; then
51 if [ -z "${CHECK_LINK}" -o \
52 "${CHECK_LINK}" = "y" -o \
53 "${CHECK_LINK}" = "yes" -o \
54 "${CHECK_LINK}" = "1" ]; then
56 # Bring up the interface
57 if ip link show
${IFACE} > /dev
/null
2>&1; then
58 link_status
=`ip link show ${IFACE}`
60 if [ -n "${link_status}" ]; then
61 if ! echo "${link_status}" |
grep -q UP
; then
62 ip link
set ${IFACE} up
67 boot_mesg
"Interface ${IFACE} doesn't exist." ${WARNING}
72 IFCONFIG
=${file} /lib/boot/${SERVICE} ${IFACE} up
75 boot_mesg
"Unable to process ${file}. Either" ${FAILURE}
76 boot_mesg
"the SERVICE variable was not set"
77 boot_mesg
"or the specified service cannot be executed."