#!/bin/sh # Set scanner vendor and product code as returned by lsusb. scandevice=04a9:170a scanner=`/sbin/lsusb -d $scandevice` bus=`echo $scanner| sed -e s/Bus\ // -e s/\ Device.\*//` device=`echo $scanner| sed -e s/Bus.\*Device\ // -e s/\:.\*//` if [ "$bus" = "" ] | [ "$device" = "" ] then echo "Unable to find scanner with vendor:product = $scandevice" exit 1 fi chmod 666 /dev/bus/usb/$bus/$device echo "Set access for $scandevice at /dev/bus/usb/$bus/$device"