[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Quick Bash question



In a shell script does:

  MODPROBE=:

do anything special besides set $MODPROBE to ":"?

Why I ask is the hotplug usb.agent script does:

    MODPROBE=:
    for MAP in $MAP_USERMAP $HOTPLUG_DIR/usb/*.usermap
    do
        if [ -r $MAP ]; then
            load_drivers usb $MAP "$LABEL"
            if [ "$DRIVERS" != "" ]; then
                FOUND=true
            fi
        fi
    done

and then in load_drives() it does:

            debug_mesg Looking for module $MODULE with modprobe=$MODPROBE
            if $MODPROBE -n $MODULE >/dev/null 2>&1 &&
                    ! $MODPROBE $MODULE >/dev/null 2>&1 ; then
                mesg "... can't load module $MODULE"
            else
                # /etc/modules.conf may have set non-default module
                # parameters ... handle per-device parameters in apps
                # (ioctls etc) not in setup scripts or modules.conf
                LOADED=true
                debug_mesg Already loaded
            fi

That debug message generates, for example:

    Looking for module scanner.sh with modprobe=:

and then displays the "Already loaded" message.

So unless ":" does something special it looks like a bug in the script.

BTW - the *usermap files are suppose to map programs or script to devices
and then run those programs when a usb device is installed.



-- 
Bill Moseley moseley@hank.org



Reply to: