fstab mount shares on wifi network

Firesam ubuntu at e17th.com
Thu Sep 8 19:17:49 UTC 2011

On Tue, 2011-09-06 at 20:38 +0100, Colin Law wrote:
> On 6 September 2011 19:55, Firesam <ubuntu at e17th.com> 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'?
> I use the this method [1] which automatically mounts shares as the
> servers becomes available.  It also unmounts if it becomes
> inaccessible.
> [1] http://ubuntuforums.org/showthread.php?t=637258
> Colin
I changed my focus a little as it seems fstab is not the best way to go
for this. I want to execute the command 'gvfs-mount
smb://shareserver/sharename' which is good because it integrates with
nautilus better and seems to work smoother. I can use a symlink if I
need a (non-hidden) path to the share.

My question now is how can I set this script to run on wireless
connection? I don't need to check which network etc. because I don't
think its a big deal if it fails to connect. I am only concerned that
when it connects to a network it should try to connect to the share.

can I just put a script in /etc/network/if-up.d/ that runs the command I


More information about the ubuntu-users mailing list