Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 97097

Summary: /etc/conf.d/net : implement and " || " - condition
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: [OLD] baselayoutAssignee: Roy Marples (RETIRED) <uberlord>
Status: RESOLVED WONTFIX    
Severity: enhancement CC: vapier
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Other   
Whiteboard:
Package list:
Runtime testing required: ---

Description Toralf Förster gentoo-dev 2005-06-26 02:35:14 UTC
Something planed in the future to have a feature like:

config_eth0=("dhcp" || "adsl")

in the network configuration ?
At work I would get an ip adress from a DHCP server while at home I would be
connected to my ISP.


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 SpanKY gentoo-dev 2005-06-26 13:01:26 UTC
i think that's kind of vague & ugly ...

cant this be done through custom runlevels ?
Comment 2 Toralf Förster gentoo-dev 2005-06-27 00:41:50 UTC
I think you mean having one runlevel using net.eth0 and another using net.ppp0.
Unfortunatly I have also specified a static ip adress in net.eth0 for the alias
eth0:1 which than would not be created - or this ip adress has to be specified
twice in two different files.
But you're right this enhancement wish is only a 'nice to have'.
Comment 3 Toralf Förster gentoo-dev 2005-06-27 01:46:41 UTC
Oh, here is an answer: http://forums.gentoo.org/viewtopic.php?p=2528591#2528591
Comment 4 Roy Marples (RETIRED) gentoo-dev 2005-06-27 02:32:33 UTC
config_eth0=( "dhcp" )
fallback_eth0=( "adsl" )

That works fine
Comment 5 SpanKY gentoo-dev 2005-06-27 05:53:32 UTC
no, what i meant was to be able to say to the net scripts 'use this config when
i am in XXX runlevel but use this other config when i am in YYY runlevel' ...
Comment 6 Toralf Förster gentoo-dev 2005-06-27 06:01:43 UTC
Ah, in fact that could be a nice feature to keep the network configuration
together in only one single file.
Comment 7 SpanKY gentoo-dev 2005-06-27 08:30:14 UTC
as discovered on irc, we already have this support in baselayout, and for all
config scripts, not just net

/etc/conf.d/<service>.<runlevel> will be used if it exists, otherwise the
default /etc/conf.d/<service> will be used

so if you create a custom runlevel called 'home' and create
/etc/conf.d/net.home, you can put your adsl settings there