aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2001-08-15 20:20:46 +0000
committerBill Nottingham <notting@redhat.com>2001-08-15 20:20:46 +0000
commitf6e1525cde05acf072129a357e02bedcd14d79c9 (patch)
tree9e65e83f3e93892c8e8fca55d7a7350cb657f274 /sysconfig/network-scripts/ifup
parent4d92a97eb8701ff9c02221f6b490002ed928b08f (diff)
downloadinitscripts-f6e1525cde05acf072129a357e02bedcd14d79c9.tar
initscripts-f6e1525cde05acf072129a357e02bedcd14d79c9.tar.gz
initscripts-f6e1525cde05acf072129a357e02bedcd14d79c9.tar.bz2
initscripts-f6e1525cde05acf072129a357e02bedcd14d79c9.tar.xz
initscripts-f6e1525cde05acf072129a357e02bedcd14d79c9.zip
add is_available() function for network devices; use it. gets rid of horribly ugly modprobe messages
Diffstat (limited to 'sysconfig/network-scripts/ifup')
-rwxr-xr-xsysconfig/network-scripts/ifup20
1 files changed, 8 insertions, 12 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 0ea87418..aec95481 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -85,18 +85,14 @@ if [ -x ${OTHERSCRIPT} ]; then
exec ${OTHERSCRIPT} ${CONFIG} $2
fi
-# is this device available? (this catches PCMCIA devices for us)
-LC_ALL= LANG= ip -o link | grep -q ${REALDEVICE}
-if [ "$?" = "1" ]; then
- alias=`modprobe -c | awk "/^alias ${REALDEVICE} / { print \\$3 }"`
- if [ -z "$alias" -o "$alias" = "off" ]; then
- exit 0
- fi
- modprobe $alias || {
- echo $"$alias device does not seem to be present, delaying ${DEVICE} initialization."
- exit 1
- }
-fi
+is_available ${REALDEVICE} || {
+ if [ "$?" = "1" ] ; then
+ echo $"$alias device does not seem to be present, delaying ${DEVICE} initialization."
+ exit 1
+ else
+ exit 0
+ fi
+}
if [ -n "${HWADDR}" ]; then
FOUNDMACADDR=`LC_ALL= LANG= ip -o link show ${REALDEVICE} | \
sed 's/.*link\/ether \([[:alnum:]:]*\).*/\1/'`