[X-Unix] automounting when a network becomes available

Stroller MacMonster at myrealbox.com
Tue Mar 15 02:41:45 PST 2005


On Mar 15, 2005, at 12:27 am, John Harrold wrote:

> I lug my powerbook around with me from school and home. I'd like to 
> set it
> up such that when a specific network becomes available nfs or samba 
> volumes
> are automatically mounted. Either that or the volumes are automatically
> mounted when I enter directories. I'm not sure how to go about doing 
> this.

I'd do it with a bash script, run as a cron job every few minutes.

It's a bit early in the morning for me to be writing Bash, so this 
won't work:

   #!/bin/bash
   if `smbclient -L mysever`
   then
      mkdir /Volumes/sharename
      mount_smbfs  //servername/sharename /Volumes/sharename
   fi

Unfortunately, shares mounted in Volumes by `mount_smbfs` don't seem to 
appear in the Finder, so one of us'll have to find another way to do 
this - either Applescript or a Darwin CLI interface I can't find right 
now. This seems quite interesting & useful to me, so I might well have 
a crack at it.

Stroller.



More information about the X-Unix mailing list