The 'mount' command will output all of the mounted filesystems. Or you can look at /proc/mounts directly. Or if you know of a certain file/directory that will always exist on that mounted filesystem but not otherwise you could check for it's existance before running your script.