I am trying setup permanent samba share mounts. That's not too hard using these instructions. But, I want them to
- Automatically remount whenever I join the network where these shares are available.
- Automatically unmount (or make access requests fail immediately instead of hanging) whenever I leave the network, i.e. avoid this automatically.
Googling suggests that AutoFS might be helpful. I gather it takes care of the 1. above but I am not sure about the 2.
The other questions about automated Samba mounts, i.e. How to mount a samba share permanently?, do not seem to address automatic remounts/unmounts, so I think this is not a duplicate.