From 644a0180b7e35b3286616517ca589c9bd5608c81 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 7 Aug 2001 06:48:29 +0000 Subject: 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) --- sysconfig/network-scripts/ifup | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'sysconfig') 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 -- cgit v1.2.1