Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Mar 2000 08:05:50 +0100
From:      Ollivier Robert <roberto@keltia.freenix.fr>
To:        freebsd-mobile@freebsd.org
Cc:        Lars Eggert <larse@isi.edu>
Subject:   Re: switching between connected/disconnected operation?
Message-ID:  <20000322080550.A7746@keltia.freenix.fr>
In-Reply-To: <14551.49718.603919.823550@hbo.isi.edu>; from larse@isi.edu on Tue, Mar 21, 2000 at 06:40:54PM %2B0000
References:  <14551.49718.603919.823550@hbo.isi.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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/<name of the file>. "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/<current-config>
/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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000322080550.A7746>