Automatically mount CIFS share while connected to a particular network and then automatically unmount
One possibility is a systemd automount. [1] Create a mount point. It cannot be under your home directory or /media. So for example create one at /mnt/4tb. [2] Then add – as an example...