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].