Re: alternate boot for internet connection
On Tue, Jun 17, 2003 at 10:25:48AM -0400, Emma Jane Hogbin wrote:
> Hey all:
>
> While we're on the topic of internet connections at boot....How could I
> make two entries in lilo: one for at home with a wireless internet, and
> one for "away" with no internet connection? I'd like to use the same
> kernel, just change some of the other stuff that loads. Is it possible to
> select which /etc/network/interfaces is called through lilo?
>
> Any ideas would be appreciated!
Well, here is one (you might not like it):
Make 2 (or more) entries in lilo.conf, each with a different
append: append=at_home, append=away.
After booting, notice that this comes up in /proc/cmdline.
Therefore, wherever /etc/network/interfaces would be called
from (not sure where), go:
if grep -q at_home /proc/cmdline; do
<use the interfaces for home>
fi
if grep -q at_work /proc/cmdline; do
<use the iterfaces for work>
fi
And don't do anything for "away".
I wouldn't say it's clean, but it would certainly work :)
(a slightly cleaner way would be to define an actual
parameter: append=interface=at_home. Then you parse that
from the script and use the corresponding file. That'd be
more flexible and less code.)
/Y - crazy scripter
--
Marbles should be kept together.
Reply to: