LJ Archive

Listing 1. Script to Load and Unload Modules Automatically for

Three Different USB Devices
#!/bin/sh
if [ "$1" = "usb" ]; then
    if [ "$ACTION" = "add" ]; then
        PROGRAM="modprobe"
    else
        PROGRAM="rmmod"
    fi
    if [ "$PRODUCT" = "6cd/103/0" ]; then
        $PROGRAM keyspan_pda
    fi
    if [ "$INTERFACE" = "3/1/1" ]; then
        $PROGRAM usbkbd
    fi
    if [ "$PRODUCT" = "841/1/0" ]; then
        $PROGRAM rio500
    fi
fi
LJ Archive