Networking Forums

Networking Forums > Computer Networking > Linux Networking > Automounting an SMB File System under certain conditions

Reply
Thread Tools Display Modes

Automounting an SMB File System under certain conditions

 
 
Shawn B
Guest
Posts: n/a

 
      07-06-2005, 12:47 AM
Hi All,

I am running a RedHat Linux on a portable machine and I want to set up an
automatic mount point only when connected to a certain network.

For instance, when I am connected to my "home" network (192.168.119), I want
the Samba mount to automatically occur. Anywhere else, and I don't want the
mount attempt to be made.

I can set up the mount manually as root, but this is a clumsy solution. Any
ideas/suggestions?


Thanks in advance

Shawn.


 
Reply With Quote
 
 
 
 
Chris Lowth
Guest
Posts: n/a

 
      07-09-2005, 03:47 PM
Shawn B wrote:
> Hi All,
>
> I am running a RedHat Linux on a portable machine and I want to set up an
> automatic mount point only when connected to a certain network.
>
> For instance, when I am connected to my "home" network (192.168.119), I want
> the Samba mount to automatically occur. Anywhere else, and I don't want the
> mount attempt to be made.
>
> I can set up the mount manually as root, but this is a clumsy solution. Any
> ideas/suggestions?
>
>
> Thanks in advance
>
> Shawn.
>
>


Why not stick some script code into /etc/rc.local, something like
[disclaimer.. "not tested"]..


# Get first 3 octets of eth0's IP address
eth0ip = `ifconfig eth0 | perl -ne '
m/inet addr\d+\.\d+\.\d+)/ && print $1\n";
'`

# If this "home", then mount the samba drive
if [ "$eth0ip" = "192.168.119" ]; then
mount //server//drive /mountpoint
fi


Chris

--
http://www.lowth.com/rope - Language for writing IpTables match
modules [GPL].
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problems for automounting in squeeze Michael Barth Linux Networking 0 08-20-2011 05:11 PM
Cluster File System DJH Linux Networking 0 08-17-2007 08:02 PM
file system nag Linux Networking 5 08-25-2006 02:24 PM
Directory Server AUtomounting Rich Bogle Linux Networking 0 06-14-2004 12:08 PM
file system David Windows Networking 1 10-21-2003 10:44 PM



1 2 3 4 5 6 7 8 9 10 11