Gentoo Archives: gentoo-user

From: Mateusz Arkadiusz Mierzwinski <mateuszmierzwinski@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: OT: tool for reading /etc/conf.d/net?
Date: Sun, 11 Jul 2010 09:48:04
Message-Id: AANLkTimozC1AePqtFR4b5uluXYIcfVXx1hJ3ZE8VA90C@mail.gmail.com
In Reply to: Re: [gentoo-user] Re: OT: tool for reading /etc/conf.d/net? by Amit Dor-Shifer
1 Wrote one in C,C++, Bash, Java or even PHP CLI ?? Try some... :)
2
3 This file is Bash script. Every line comes with some portion of "variable =
4 variable data". It's realy simple. In PHP you can write simple script using
5 explode functions or regexp's.
6
7 Good luck
8
9 2010/7/11 Amit Dor-Shifer <amitds@××××××.com>
10
11 >
12 >
13 > On 07/08/10 15:13, Remy Blank wrote:
14 >
15 >> Amit Dor-Shifer wrote:
16 >>
17 >>
18 >>> Can anyone recommend a tool that can parse networking info from a/m
19 >>> file, so one can use it to query, e.g. what is the static IP configured
20 >>> on eth0?
21 >>>
22 >>>
23 >> bash?
24 >>
25 >> No, I'm not joking. The file is a bash script, and hence can just be
26 >> sourced by another bash script, which could then print the relevant
27 >> information in any desired format.
28 >>
29 >> -- Remy
30 >>
31 >>
32 >>
33 > I'll try it out.
34 > However, as bash doesn't know net syntax, I'd still have to go the
35 > extra-mile for stuff such as extracting IP from the config_ variable, when
36 > that also contains a netmask (e.g. CIDR notation or "netmask" definition
37 > following the ip).
38 > Amit
39 >
40 >
41
42
43 --
44 Mateusz Mierzwiński
45
46 Bluebox Software http://www.blueboxsoft.pl/mateusz-mierzwinski

Replies

Subject Author
Re: [gentoo-user] Re: OT: tool for reading /etc/conf.d/net? Mateusz Arkadiusz Mierzwinski <mateuszmierzwinski@×××××.com>