#!/bin/sh
. /mod/etc/conf/toolbox.cfg
FUUSB_PATH=`mount | grep 'sda.' | awk '{print$3}' | grep 'uStor01'`
SUPPORT_DIR=usb_support_files/usb_devices
WAITTIME=5
INTERVALL=2
cd $FUUSB_PATH/usb_support_files
rm -r usb_devices 2>/dev/null
sleep 2
if [ ! -d $FUUSB_PATH/$SUPPORT_DIR ]; then mkdir -p $FUUSB_PATH/$SUPPORT_DIR;fi
until [ -e /usr/sbin/listusb ]
do
sleep $INTERVALL
[ -e /usr/sbin/listusb ]
sleep $WAITTIME
done
sleep 3
if [ ! -f $FUUSB_PATH/usb_support_files/list_usb/list_usb ]; then mkdir -p $FUUSB_PATH/usb_support_files/list_usb;fi
sleep 1
listusb -v > $FUUSB_PATH/usb_support_files/list_usb/list_usb
sleep 2
if [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 002/,/TRENNER/p' | grep 'bDeviceClass' | awk '{print$3}' | sed -n '1,1p')" = "Hub" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 001/,/TRENNER/p' | egrep 'bcdUSB|iProduct|bInterfaceProtocol|Port 1:' > $FUUSB_PATH/$SUPPORT_DIR/001_Root
fi
if [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 002/,/TRENNER/p' | grep 'bDeviceClass' | awk '{print$3}' | sed -n '1,1p')" = "Hub" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 002/,/TRENNER/p' | egrep 'bcdUSB|idVendor|idProduct|iManufacturer|iProduct|bInterfaceProtocol|Port 1:|Port 2:|Port 3:|Port 4:|Port 5:|Port 6:|Port 7:' > $FUUSB_PATH/$SUPPORT_DIR/002_Root
fi
if [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 003/,/TRENNER/p' | grep 'bDeviceClass' | awk '{print$3}' | sed -n '1,1p')" = "Hub" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 003/,/TRENNER/p' | egrep 'bcdUSB|idVendor|idProduct|iManufacturer|iProduct|bInterfaceProtocol|Port 1:|Port 2:|Port 3:|Port 4:|Port 5:|Port 6:|Port 7:' > $FUUSB_PATH/$SUPPORT_DIR/003_Hub
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 003/,/TRENNER/p' | grep 'bInterfaceClass' | awk '{print$3,$4}')" = "Mass Storage" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 003/,/TRENNER/p' | egrep 'iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/003_Storage
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 003/,/TRENNER/p' | grep 'idProduct' | awk '{print$3}')" = "PL2303" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 003/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct' > $FUUSB_PATH/$SUPPORT_DIR/003_Serial
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 003/,/TRENNER/p' | grep 'iProduct' | awk '{print$3}')" = "FT232R" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 003/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/003_CARDREADER
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 003/,/TRENNER/p' | grep 'iInterface' | awk '{print$4}')" = "smartcard" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 003/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/003_CARDREADER
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 003/,/TRENNER/p' | grep 'iProduct' | awk '{print$3}')" = "Smartmouse" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 003/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/003_CARDREADER
fi
if [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 004/,/TRENNER/p' | grep 'bDeviceClass' | awk '{print$3}' | sed -n '1,1p')" = "Hub" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 004/,/TRENNER/p' | egrep 'bcdUSB|idVendor|idProduct|iManufacturer|iProduct|bInterfaceProtocol|Port 1:|Port 2:|Port 3:|Port 4:|Port 5:|Port 6:|Port 7:' > $FUUSB_PATH/$SUPPORT_DIR/004_Hub
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 004/,/TRENNER/p' | grep 'bInterfaceClass' | awk '{print$3,$4}')" = "Mass Storage" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 004/,/TRENNER/p' | egrep 'iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/004_Storage
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 004/,/TRENNER/p' | grep 'idProduct' | awk '{print$3}')" = "PL2303" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 004/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|bcdUSB|iProduct' > $FUUSB_PATH/$SUPPORT_DIR/004_Serial
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 004/,/TRENNER/p' | grep 'iProduct' | awk '{print$3}')" = "FT232R" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 004/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/004_CARDREADER
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 004/,/TRENNER/p' | grep 'iInterface' | awk '{print$4}')" = "smartcard" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 004/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/004_CARDREADER
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 004/,/TRENNER/p' | grep 'iProduct' | awk '{print$3}')" = "Smartmouse" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 004/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/004_CARDREADER
fi
if [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 005/,/TRENNER/p' | grep 'bDeviceClass' | awk '{print$3}' | sed -n '1,1p')" = "Hub" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 005/,/TRENNER/p' | egrep 'bcdUSB|idVendor|idProduct|iManufacturer|iProduct|bInterfaceProtocol|Port 1:|Port 2:|Port 3:|Port 4:|Port 5:|Port 6:|Port 7:' > $FUUSB_PATH/$SUPPORT_DIR/005_Hub
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 005/,/TRENNER/p' | grep 'bInterfaceClass' | awk '{print$3,$4}')" = "Mass Storage" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 005/,/TRENNER/p' | egrep 'iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/005_Storage
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 005/,/TRENNER/p' | grep 'idProduct' | awk '{print$3}')" = "PL2303" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 005/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|bcdUSB|iProduct' > $FUUSB_PATH/$SUPPORT_DIR/005_Serial
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 005/,/TRENNER/p' | grep 'iProduct' | awk '{print$3}')" = "FT232R" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 005/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/005_CARDREADER
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 005/,/TRENNER/p' | grep 'iInterface' | awk '{print$4}')" = "smartcard" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 005/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/005_CARDREADER
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 005/,/TRENNER/p' | grep 'iProduct' | awk '{print$3}')" = "Smartmouse" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 005/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/005_CARDREADER
fi
if [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 006/,/TRENNER/p' | grep 'bDeviceClass' | awk '{print$3}' | sed -n '1,1p')" = "Hub" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 006/,/TRENNER/p' | egrep 'bcdUSB|idVendor|idProduct|iManufacturer|iProduct|bInterfaceProtocol|Port 1:|Port 2:|Port 3:|Port 4:|Port 5:|Port 6:|Port 7:' > $FUUSB_PATH/$SUPPORT_DIR/006_Hub
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 006/,/TRENNER/p' | grep 'bInterfaceClass' | awk '{print$3,$4}')" = "Mass Storage" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 006/,/TRENNER/p' | egrep 'iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/006_Storage
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 006/,/TRENNER/p' | grep 'idProduct' | awk '{print$3}')" = "PL2303" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 006/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|bcdUSB|iProduct' > $FUUSB_PATH/$SUPPORT_DIR/006_Serial
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 006/,/TRENNER/p' | grep 'iProduct' | awk '{print$3}')" = "FT232R" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 006/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/006_CARDREADER
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 006/,/TRENNER/p' | grep 'iInterface' | awk '{print$4}')" = "smartcard" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 006/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/006_CARDREADER
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 006/,/TRENNER/p' | grep 'iProduct' | awk '{print$3}')" = "Smartmouse" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 006/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/006_CARDREADER
fi
if [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 007/,/TRENNER/p' | grep 'bDeviceClass' | awk '{print$3}' | sed -n '1,1p')" = "Hub" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 007/,/TRENNER/p' | egrep 'bcdUSB|idVendor|idProduct|iManufacturer|iProduct|bInterfaceProtocol|Port 1:|Port 2:|Port 3:|Port 4:|Port 5:|Port 6:|Port 7:' > $FUUSB_PATH/$SUPPORT_DIR/007_Hub
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 007/,/TRENNER/p' | grep 'bInterfaceClass' | awk '{print$3,$4}')" = "Mass Storage" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 007/,/TRENNER/p' | egrep 'iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/007_Storage
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 007/,/TRENNER/p' | grep 'idProduct' | awk '{print$3}')" = "PL2303" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 007/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|bcdUSB|iProduct' >$FUUSB_PATH/$SUPPORT_DIR/007_Serial
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 007/,/TRENNER/p' | grep 'iProduct' | awk '{print$3}')" = "FT232R" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 007/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/007_CARDREADER
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 007/,/TRENNER/p' | grep 'iInterface' | awk '{print$4}')" = "smartcard" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 007/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/007_CARDREADER
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 007/,/TRENNER/p' | grep 'iProduct' | awk '{print$3}')" = "Smartmouse" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 007/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/007_CARDREADER
fi
if [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 008/,/TRENNER/p' | grep 'bDeviceClass' | awk '{print$3}' | sed -n '1,1p')" = "Hub" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 008/,/TRENNER/p' | egrep 'bcdUSB|idVendor|idProduct|iManufacturer|iProduct|bInterfaceProtocol|Port 1:|Port 2:|Port 3:|Port 4:|Port 5:|Port 6:|Port 7:' > $FUUSB_PATH/$SUPPORT_DIR/008_Hub
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 008/,/TRENNER/p' | grep 'bInterfaceClass' | awk '{print$3,$4}')" = "Mass Storage" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 008/,/TRENNER/p' | egrep 'iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/008_Storage
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 008/,/TRENNER/p' | grep 'idProduct' | awk '{print$3}')" = "PL2303" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 008/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|bcdUSB|iProduct' > $FUUSB_PATH/$SUPPORT_DIR/008_Serial
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 008/,/TRENNER/p' | grep 'iProduct' | awk '{print$3}')" = "FT232R" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 008/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/008_CARDREADER
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 008/,/TRENNER/p' | grep 'iInterface' | awk '{print$4}')" = "smartcard" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 008/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/008_CARDREADER
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 008/,/TRENNER/p' | grep 'iProduct' | awk '{print$3}')" = "Smartmouse" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 008/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/008_CARDREADER
fi
if [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 009/,/TRENNER/p' | grep 'bDeviceClass' | awk '{print$3}' | sed -n '1,1p')" = "Hub" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 009/,/TRENNER/p' | egrep 'bcdUSB|idVendor|idProduct|iManufacturer|iProduct|bInterfaceProtocol|Port 1:|Port 2:|Port 3:|Port 4:|Port 5:|Port 6:|Port 7:' > $FUUSB_PATH/$SUPPORT_DIR/009_Hub
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 009/,/TRENNER/p' | grep 'bInterfaceClass' | awk '{print$3,$4}')" = "Mass Storage" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 009/,/TRENNER/p' | egrep 'iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/009_Storage
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 009/,/TRENNER/p' | grep 'idProduct' | awk '{print$3}')" = "PL2303" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 009/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|bcdUSB|iProduct' > $FUUSB_PATH/$SUPPORT_DIR/009_Serial
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 009/,/TRENNER/p' | grep 'iProduct' | awk '{print$3}')" = "FT232R" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 009/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/009_CARDREADER
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 009/,/TRENNER/p' | grep 'iInterface' | awk '{print$4}')" = "smartcard" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 009/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/009_CARDREADER
elif [ "$(cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 009/,/TRENNER/p' | grep 'iProduct' | awk '{print$3}')" = "Smartmouse" ]; then
cat $FUUSB_PATH/usb_support_files/list_usb/list_usb | sed '/Bus 001 Device/ i\TRENNER' | sed -n '/Device 009/,/TRENNER/p' | egrep 'idVendor|idProduct|iManufacturer|iProduct|iSerial|bcdUSB' > $FUUSB_PATH/$SUPPORT_DIR/009_CARDREADER
fi