The device name should appear in dmesg
. Try something like this:
dev_name="/dev/"`dmesg | perl -ne '/.+\[(.+?)\] Attached/ && do' | tail -n 1`
Assuming that your USB dongle is the last device attached (hence the tail -n1
), this should save the device name as $dev_name
.