fstab mount shares on wifi network

Mike McGinn mikemcginn at mcginnweb.net
Tue Sep 6 19:18:08 UTC 2011

On Tuesday, September 06, 2011 14:55:52 Firesam wrote:
> How can I add an entry to fstab that mounts a samba share that is on a
> wireless network. The problem is that the network is not available until
> networkmanager connects to the lan. That only happens after I login to
> unity with my password. I dont think _netdev will help in this case. Is
> it smarter to use a script on connect to the network that will 'mount
> -a'?
You have to create a script in /etc/NetworkManager/dispatcher.d/
I called mine 05-mnt-hshares
I have it look at the essid 
I am quoting it below
# /etc/NetworkManager/dispatcher.d/05-mnt-hshares
# mount the shares I use at home when we connect
export LC_ALL=C
if [ "$1" = "eth1" ]; then
        if [ "$2" = "up" ]; then
                SSID=`iwconfig $IFACE | awk -F\" '{print $2}'`
#       unmount work shares
#       mount home shares
                if [ "$SSID" = "fishnet" ]; then
#               /usr/sbin/vpnc
        if [ "$2" = "down" ]; then
#               /usr/sbin/vpnc-disconnect

The script /root/bin/homeNetStuff.sh
#resolvconf -u
smbmount //homestore/ourStuff/mikeBackUp /home/homeStore -o\ 
credentials=/home/mike/.hoStore.cred user=mike
smbmount //homestore/ourStuff /home/ourStuff -o\ 
credentials=/home/mike/.hoStore.cred user=mike

Mike McGinn		FACOCM
Ex Uno Plurima
No electrons were harmed in sending this message.
** Registered Linux User 377849

More information about the ubuntu-users mailing list