aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2001-08-07 06:48:29 +0000
committerBill Nottingham <notting@redhat.com>2001-08-07 06:48:29 +0000
commit644a0180b7e35b3286616517ca589c9bd5608c81 (patch)
tree4aca889e63ebc7237519b9d9cc73ce48ffdb847e /sysconfig
parentd34451922aebdabfc5495b174ad960b0a0188304 (diff)
downloadinitscripts-644a0180b7e35b3286616517ca589c9bd5608c81.tar
initscripts-644a0180b7e35b3286616517ca589c9bd5608c81.tar.gz
initscripts-644a0180b7e35b3286616517ca589c9bd5608c81.tar.bz2
initscripts-644a0180b7e35b3286616517ca589c9bd5608c81.tar.xz
initscripts-644a0180b7e35b3286616517ca589c9bd5608c81.zip
use awk, not grep & other cruft (#49616)
exit happily if ifup is called on a device that doesn't exist and has no alias (fixes all those nasty PCMCIA onboot complaints)
Diffstat (limited to 'sysconfig')
-rwxr-xr-xsysconfig/network-scripts/ifup12
1 files changed, 8 insertions, 4 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index de25961d..7bc43c4c 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -50,11 +50,11 @@ source_config
if [ "foo$2" = "fooboot" -a "${ONBOOT}" = "no" -o "${ONBOOT}" = "NO" ]
then
- exit
+ exit 0
fi
if [ -n "$IN_HOTPLUG" -a "${HOTPLUG}" = "no" -o "${HOTPLUG}" = "NO" ]
then
- exit
+ exit 0
fi
# figure out more about what we are dealing with
@@ -88,8 +88,12 @@ fi
# is this device available? (this catches PCMCIA devices for us)
LC_ALL= LANG= ip -o link | grep -q ${REALDEVICE}
if [ "$?" = "1" ]; then
- LC_ALL=C modprobe -c | grep -q ${REALDEVICE} && modprobe ${REALDEVICE} || {
- echo $"Device does not seem to be present, delaying ${DEVICE} initialization."
+ 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