From owner-freebsd-mobile Tue Mar 21 23:29: 3 2000 Delivered-To: freebsd-mobile@freebsd.org Received: from frmug.org (frmug-gw.frmug.org [193.56.58.252]) by hub.freebsd.org (Postfix) with ESMTP id D1BE237BC62 for ; Tue, 21 Mar 2000 23:28:59 -0800 (PST) (envelope-from roberto@keltia.freenix.fr) Received: (from uucp@localhost) by frmug.org (8.9.3/frmug-2.5/nospam) with UUCP id IAA10135; Wed, 22 Mar 2000 08:28:57 +0100 (CET) (envelope-from roberto@keltia.freenix.fr) Received: by keltia.freenix.fr (Postfix, from userid 101) id B4DB98869; Wed, 22 Mar 2000 08:05:50 +0100 (CET) Date: Wed, 22 Mar 2000 08:05:50 +0100 From: Ollivier Robert To: freebsd-mobile@freebsd.org Cc: Lars Eggert Subject: Re: switching between connected/disconnected operation? Message-ID: <20000322080550.A7746@keltia.freenix.fr> Mail-Followup-To: freebsd-mobile@freebsd.org, Lars Eggert References: <14551.49718.603919.823550@hbo.isi.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <14551.49718.603919.823550@hbo.isi.edu>; from larse@isi.edu on Tue, Mar 21, 2000 at 06:40:54PM +0000 X-Operating-System: FreeBSD 4.0-CURRENT/ELF AMD-K6/200 & 2x PPro/200 SMP Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org According to Lars Eggert: > Has anyone ever done this? How? Any pointers? This is for 4.0-RELEASE, > btw. I have a system where a few important files (/etc/rc.conf, /etc/hosts and some others) are symlinked to /etc/conf/current/. "current" is itself a symlink to the right directory in /etc/conf. I have a "switch-to" script that change the symlink to whatever config. was specified and run another script (on a per configuration basis) to run some commands (mainly to change interface(s) IP address(es) and restart Postfix). The structure is as follow /etc/conf/home/{params,hosts,resolv.conf,printcap,main.cf} /etc/conf/eec/{params,hosts,resolv.conf,printcap,main.cf} /etc/conf/current -> /etc/conf/ /etc/conf/bin/ifconfig and /etc/hosts -> /etc/current/hosts /etc/printcap -> /etc/current/printcap /etc/postfix/main.cf -> /etc/current/main.cf You see the picture. The 'ifconfig' script reads a few variables in "/etc/conf/current/params" and resets interfaces. 'ifconfig' is run by "switch-to" after changing the symlink to the right config. -- Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto@keltia.freenix.fr FreeBSD keltia.freenix.fr 4.0-CURRENT #78: Sun Feb 27 15:32:39 CET 2000 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message