usbfilter/authorize_scan.sh

13 lines
253 B
Bash
Raw Normal View History

2014-08-03 12:21:04 +02:00
#!/bin/bash
cd /sys/bus/usb/devices/
ls | grep -v : | while read device ; do
idProduct=$(cat $device/idProduct)
idVendor=$(cat $device/idVendor)
grep "$idVendor:$idProduct" /etc/usb_whitelist
if [ $? -eq 0 ] ; then
echo 1 > $device/authorized
fi
done