Você terá que escrever um script. Este é um esqueleto / modelo, chame-o de net_mount e coloque-o em /etc/NetworkManager/dispatcher.d
#!/bin/sh
# auto mount/umount network shares
IF=
STATUS=
# set your desired network here
NETMASK="192.168.0.0/24"
mount_shares (){
# command(s) to mount shares here
mount share1
mount share2
....
}
umount_shares (){
# command(s) to un-mount shares here
umount share1
umount share2
....
}
if [ -n "'/sbin/ip addr show $IF to $NETMASK'" ]; then
case "$STATUS" in
up)
mount_shares
;;
pre-down)
umount_shares
;;
*)
;;
esac
else
umount_shares
fi
Torne-o executável
sudo chmod a+x /etc/NetworkManager/dispatcher.d/net_mount