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) --- rc.d/rc.sysinit | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rc.d/rc.sysinit') diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 6b134798..6006907d 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -160,12 +160,12 @@ action $"Setting hostname ${HOSTNAME}: " hostname ${HOSTNAME} # Initialize USB controller and HID devices usb=0 if ! grep -iq "nousb" /proc/cmdline 2>/dev/null && ! grep -q "usb" /proc/devices 2>/dev/null ; then - aliases=`/sbin/modprobe -c | egrep -s "^alias[[:space:]]+usb-controller" | awk '{ print $3 }'` + aliases=`/sbin/modprobe -c | awk '/^alias usb-controller/ { print $3 }'` if [ -n "$aliases" -a "$aliases" != "off" ] ; then modprobe usbcore action $"Mounting USB filesystem: " mount -t usbdevfs usbdevfs /proc/bus/usb for alias in $aliases ; do - action $"Initializing USB controller ($alias): " modprobe $alias + [ "$alias" != "off" ] && action $"Initializing USB controller ($alias): " modprobe $alias done [ $? -eq 0 -a -n "$aliases" ] && usb=1 fi @@ -403,12 +403,12 @@ fi # Load sound modules iff they need persistent DMA buffers if grep -q "options sound dmabuf=1" /etc/modules.conf 2>/dev/null ; then RETURN=0 - alias=`/sbin/modprobe -c | egrep -s "^alias[[:space:]]+sound[[:space:]]+" | awk '{ print $3 }'` + alias=`/sbin/modprobe -c | awk '/^alias sound / { print $3 }'` if [ -n "$alias" -a "$alias" != "off" ] ; then action $"Loading sound module ($alias): " modprobe $alias RETURN=$? fi - alias=`/sbin/modprobe -c | egrep -s "^alias[[:space:]]+sound-slot-0[[:space:]]+" | awk '{ print $3 }'` + alias=`/sbin/modprobe -c | awk '/^alias sound-slot-0 / { print $3 }'` if [ -n "$alias" -a "$alias" != "off" ] ; then action $"Loading sound module ($alias): " modprobe $alias RETURN=$? -- cgit v1.2.1