lsusb in shell script

  • Hi.
    Sometimes it's necessary to list USB devices connected to your box. On a a normal Linux machine you'd use lsusb program but on some dreambox images it may not be available.


    So here's a shell script that will do the job for you.


    The script is based on a work of somebody else (don't know who). Some time ago I found it on the internet but...
    1. it was broken
    2. after fixing it, it didn't show device names just like the original program does.


    My modification will get device names from /usr/share/usb.ids or /usr/share/usb.ids.gz depending on what is avialable in your system. The script will try to download this file for you if you don't have any of the above.


    Tested on my dm800 - works like a charm.


    Just gunzip, untar it to /usr/bin. In the package there's a directory structure already so you can just copy it as it is.


    Make sure this script is executable after unpacking (chmod +x /usr/bin/lsusb).



    Edit: I found out whom I got the original script from - It's taken from lataamo's plugin so original credits to him.
    Edit2: I just found the same code in one of the DE1.33 scripts so I'm not sure who wrote it first ;).


    Enjoy.