Gentoo Archives: gentoo-dev

From: Francesco Riosa <vivo@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] New network config for baselayout-ng
Date: Wed, 07 Feb 2007 15:02:07
Message-Id: 45C9E91A.7050703@gentoo.org
In Reply to: Re: [gentoo-dev] New network config for baselayout-ng by Patrick McLean
1 Patrick McLean ha scritto:
2 > Roy Marples wrote:
3 >> Welcome to baselayout-ng which will be a virtual and will not require
4 >> bash.
5 >
6 > So this means that you are planning to stop development of the current
7 > baselayout in favor of baselayout-ng?
8 >
9 >>
10 >> We still need something that is "array like" for want of a better
11 >> phrase, so how about delimiting using ; like so
12 >> config_eth0="10.1.1.1 netmask 255.255.255.0; 10.1.1.2/24"
13 >>
14 >
15 > Couldn't you use the current config on bash shells and parse it to
16 > something like that on non-bash. There is no reason why the shell needs
17 > to source the config file, it could be parsed just as easily, and
18 > writing the parser shouldn't be too hard with a bit of sed magic.
19
20 I was thinking to something similar:
21
22 with net:
23 8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<
24 config_eth0=(
25 "10.1.1.{1..30}/8"
26 "192.168.0.1 netmask 255.255.255.0"
27 )
28
29 config_eth1=(
30 "10.1.2.{1..30}/8"
31 "192.168.1.1 netmask 255.255.255.0"
32 )
33 8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<
34
35 this command:
36
37 echo -e $(sed -e 's|=(|<<<|g;s|)|>>>|g' net) | sed -e 's|"
38 "|;|g;s|"||g;s|<<<|="|g;s|>>>|"\n|g'
39
40 output something like:
41
42 8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<
43 config_eth0=" 10.1.1.{1..30}/8;192.168.0.1 netmask 255.255.255.0
44 config_eth1=" 10.1.2.{1..30}/8;192.168.1.1 netmask 255.255.255.0
45 8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<
46
47 --
48 gentoo-dev@g.o mailing list