I need to write a simple scripts file that will check if the partition on a USB memory stick has been mounted and then unmount the partition if it is already mounted. Currently, I have an indea to achieve this with the following scripts:
[ -d "/usb/lost+found" ] && umount /usb
I believe this will only work if the partition is formatted with a Un*x/Linux filesystem type. Is there a better way to achieve this regardless what filesystem type?