Bash Script to Detect USB drive mount status
I'm trying to write a script to detect if a USB drive mounted correctly. The problem I'm having is that the error code returned from mount /mnt/usb by $? when a drive is missing, is the same as if the drive has already been mounted, or is incompatible. I've tried getting $? from ls, du and df but they all respond with 0 whether the drive is there or not.
Does anyone know how to get around this? I just need to know if the drive mounted OK and if not what the problem was.