Suppose do you want test if /mnt/disk is a mount point in a shell script. How do you do this?
Unfortunately both mountpoint and stat will have the side-effect of MOUNTING the directory you are testing if you are using automount. Or at least it does for me on Debian using auto cifs to a WD MyBookLive networked disk. I ended up with a variant of the /proc/mounts made more complex because each POTENTIAL mount is already in /proc/mounts even if its not actually mounted!
cut -d ' ' -f 1 < /proc/mounts | grep -q '^//disk/Public$' && umount /tmp/cifs/disk/Public
Where 'disk' is the name of the server (networked disk) in /etc/hosts. '//disk/Public' is the cifs share name '/tmp/cifs' is where my automounts go (I have /tmp as RAM disk and / is read-only) '/tmp/cifs/disk' is a normal directory created when the server (called 'disk') is live. '/tmp/cifs/disk/Public' is the mount point for my 'Public' share.