If you can script the mount command and stick the script into /etc/network/if-up.d, your mount will run as soon as your network is up. A similar umount script thrown into /etc/network/if-down.d should bring it down. Make sure the scripts are executable and is owned by root.
The following is an example of a mount script called by wireless network. (call it say 'mntNetShare' and change "wlan0" if not wireless by looking at the output of 'ifconfig')
Code:
#!/bin/bash
if [ "$IFACE" = "wlan0" ]; then
mount -t cifs -o rw,user=XXX,pass=XXX,iocharset=utf8,file_mode=0777,file_mode=0777,dir_mode=0777,uid=XXX //192.168.0.242/websites /mnt/supercube
fi
Create a similar script for umount and remove your fstab entry.
FYI, I use a similar script but serves me another purpose.
Bookmarks