Date: Tue, 28 Oct 1997 07:43:27 +0100 From: Poul-Henning Kamp <phk@critter.freebsd.dk> To: Warner Losh <imp@village.org> Cc: freebsd-mobile@freebsd.org Subject: Re: How do you solve... Message-ID: <3178.878021007@critter.freebsd.dk> In-Reply-To: Your message of "Mon, 27 Oct 1997 14:06:04 MST." <199710272106.OAA05353@harmony.village.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <199710272106.OAA05353@harmony.village.org>, Warner Losh writes: >In message <1548.877976963@critter.freebsd.dk> Poul-Henning Kamp writes: >: I have two small aliases that >: >: home (rm -f /var/tmp/@work) >: work (touch /var/tmp/@work) >: >: my /etc/pccard.ether (or whatever it is called today) looks for >: this file and decideds which IP to configure. Works great. > >So you type "home" and then plug the ethernet card in when you get >home in the evenings? Then /etc/pccard.ether does its magic, no? yes. if [ -f /var/tmp/@work ] ; ifconfig this that and something echo "bla\nbla\nbla" > /etc/resolv.conf else ifconfig something quite different echo "mumble\nmumble\nmumble" > /etc/resolv.conf fi >I was thinking of doing DHCP or even a simple ifconfig <home-addr> >ping home-host failure -> ifconfig <work-addr> ping work-host failure >-> loop a reasonable number of times, then prompt with a Tk program or >something like that. And then once I know where I am, I can wonk >resolv.conf, et al to do the right thing. Been there done that. I found out the above worked better for me. I also have some scripts for another couple of places I go occasionally. -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop."
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3178.878021007>