From owner-freebsd-mobile Mon Oct 27 22:44:46 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id WAA01108 for mobile-outgoing; Mon, 27 Oct 1997 22:44:46 -0800 (PST) (envelope-from owner-freebsd-mobile) Received: from critter.freebsd.dk (critter.freebsd.dk [195.8.129.26]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id WAA01100 for ; Mon, 27 Oct 1997 22:44:40 -0800 (PST) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost.cybercity.dk [127.0.0.1]) by critter.freebsd.dk (8.8.7/8.8.7) with ESMTP id HAA03180; Tue, 28 Oct 1997 07:43:36 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: Warner Losh cc: freebsd-mobile@freebsd.org Subject: Re: How do you solve... In-reply-to: Your message of "Mon, 27 Oct 1997 14:06:04 MST." <199710272106.OAA05353@harmony.village.org> Date: Tue, 28 Oct 1997 07:43:27 +0100 Message-ID: <3178.878021007@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-mobile@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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 >ping home-host failure -> ifconfig 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."