I have a wifi access point that allows to plug a USB hard drive accessible from any computer sharing the same wifi. I would like to know if there was a way a shell script could test if something is plugged there or not.
If there is a way to check which USB key or hard drive is plugged would be a delight, but I'm not asking that much.
The goal is to check if the drive is on before I can work with the files. I want to access the drive using samba. The IP is
192.168.0.1. I can get the name of the drive, but the IP is fix, whichever drive I plug.
NOTE: my final goal is to upload files on that drive with a shell script. I don't mind if you give me another way to do it: SSH, FTP, HTTP, morse code, …