From f6e1525cde05acf072129a357e02bedcd14d79c9 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 15 Aug 2001 20:20:46 +0000 Subject: add is_available() function for network devices; use it. gets rid of horribly ugly modprobe messages --- rc.d/init.d/network | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/network b/rc.d/init.d/network index 7ab4ec75..009f9bc6 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -40,6 +40,8 @@ fi CWD=`pwd` cd /etc/sysconfig/network-scripts +. network-functions + # find all the interfaces besides loopback. # ignore aliases, alternative configurations, and editor backup files interfaces=`ls ifcfg* | LANG=C egrep -v '(ifcfg-lo|:|rpmsave|rpmorig|rpmnew)' | \ @@ -76,16 +78,14 @@ case "$1" in sysctl -w kernel.hotplug="/bin/true" > /dev/null 2>&1 for i in $interfaces; do - if LANG=C egrep -L "^ONBOOT=\"?[Nn][Oo]\"?" ifcfg-$i >/dev/null 2>&1 ; then - if [ "${i##eth}" != "$i" ]; then - # Probe module to preserve interface ordering - if [ -n "`modprobe -vn $i | grep -v Note:`" ]; then - /sbin/ifconfig $i >/dev/null 2>&1 - fi - fi - else - # If we're in confirmation mode, get user confirmation - [ -n "$CONFIRM" ] && + if [ "${i##eth}" != "$i" ] && ! is_available $i ; then + continue + fi + if LANG=C egrep -L "^ONBOOT=\"?[Nn][Oo]\"?" ifcfg-$i > /dev/null ; then + continue + fi + # If we're in confirmation mode, get user confirmation + [ -n "$CONFIRM" ] && { confirm $i case $? in @@ -99,10 +99,9 @@ case "$1" in continue ;; esac - } + } - action $"Bringing up interface $i: " ./ifup $i boot - fi + action $"Bringing up interface $i: " ./ifup $i boot done # add cipe here. -- cgit v1.2.1