--- tools/hotplug/libusbscanner 2004-05-10 08:28:34.537782880 +0200 +++ libusbscanner.new 2004-05-10 08:32:05.998691893 +0200 @@ -13,6 +13,14 @@ # DEVICE=/proc/bus/usb/BBB/DDD # TYPE=usb + +if [ -z "$DEVICE" ] ; then + IF=$(echo $DEVPATH | sed 's:\(bus/usb/devices/\)\(.*\)-\(.*\):\2:') + DEV=$(echo $DEVPATH | sed 's:\(bus/usb/devices/\)\(.*\)-\(.*\):\3:') + DEV=$(expr $DEV + 1) + DEVICE=$(printf '/proc/bus/usb/%.03d/%.03d' $IF $DEV) +fi + if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then chown root:scanner "$DEVICE" chmod 0660 "$DEVICE"