I wrote a script which formats USB pendrive and place media on it. It helps people in a library getting a bunch of HTML and media on it to browse historical data (official version).
All my script do the job well (formatting, mounting, copying, unmounting, say "goodbye"). But one point: how to know which device should I browse.
One only condition: there is still MAXimum 1 pendrive plugged in.
There is generally 3 people by day comming to plug their (USB!) stick in the machine (it looks like a buck-machine for credit card).
My Question Please help, I dont know what to do to say my script :
Hey, the only USB device is /dev/sdX1
Or
Hey, no USB pendrive in my I/O.
Thank you