Re: Location manager type tool?


Subject: Re: Location manager type tool?
From: Bill Fink (billfink@capu.net)
Date: Thu Feb 08 2001 - 19:14:30 MST


This is basically what I did also, except I never bothered creating
the script (I just copied the files by hand since I didn't move the
desktop system in question very often). I see you discovered that
the ifcfg files in /etc/sysconfig/network-scripts need to use a
{home,work} prefix instead of a {home,work} suffix. My case was
further complicated by having ethernet aliases at home (ifcfg-eth0:1
and ifcfg-eth0:2) but not at work.

Some other tips for others that might be interested. Make sure you
have both hostnames in /etc/hosts or have both /etc/hosts.home and
/etc/hosts.work versions. Some other files that I needed both home
and work versions of included /etc/sysconfig/static-routes and
/etc/X11/XF86Config (or /etc/X11/XF86Config-4), the latter because
I used different monitors at home and work for the desktop system
I moved.

Some other files that might also need to be changed going from home
to work or vice versa include /etc/hosts.allow and the ssh configuration
files, and I'm sure there are others (e.g. ipchains).

It would definitely be nice if there was a location manager type
of tool to automate this. Fortunately I don't have to deal with it
that often.

                                                -Bill

> On Thu Feb 08 2001, Philip Good wrote:
>
> Here is what I use, it's not much, but works:
>
> # eth-switch
> #
> # switch between home and work ethernet
> #
> if [ $1 == "home" ]; then
> echo "Switching to home:"
> cp -f /etc/resolv.conf.home /etc/resolv.conf
> cp -f /etc/sysconfig/network.home /etc/sysconfig/network
> cp -f /etc/sysconfig/network-scripts/home.ifcfg-eth0
> /etc/sysconfig/network-scripts/ifcfg-eth0`
> cp -f /etc/sysconfig/network-scripts/home.ifcfg-airport
> /etc/sysconfig/network-scripts/ifcfg-airport
> /etc/rc.d/init.d/network restart
> elif [ $1 == "work" ]; then
> echo "Switching to work:"
> cp -f /etc/resolv.conf.work /etc/resolv.conf
> cp -f /etc/sysconfig/network.work /etc/sysconfig/network
> cp -f /etc/sysconfig/network-scripts/work.ifcfg-eth0
> /etc/sysconfig/network-scripts/ifcfg-eth0
> /etc/rc.d/init.d/network restart
> else
> echo "Not a valid option: $1"
> fi
> ##
>
> I'd like to make it more generic and check to make sure all the cp's
> worked, but for now its simple and works. Just make sure you have the
> files defined which are copied back and forth.



This archive was generated by hypermail 2a24 : Thu Feb 08 2001 - 19:55:06 MST