Gentoo Archives: gentoo-user

From: Amit Dor-Shifer <amitds@××××××.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 08:44:12
Message-Id: 4C398429.7070107@oversi.com
In Reply to: [gentoo-user] Re: OT: tool for reading /etc/conf.d/net? by Remy Blank
1 On 07/08/10 15:13, Remy Blank wrote:
2 > Amit Dor-Shifer wrote:
3 >
4 >> Can anyone recommend a tool that can parse networking info from a/m
5 >> file, so one can use it to query, e.g. what is the static IP configured
6 >> on eth0?
7 >>
8 > bash?
9 >
10 > No, I'm not joking. The file is a bash script, and hence can just be
11 > sourced by another bash script, which could then print the relevant
12 > information in any desired format.
13 >
14 > -- Remy
15 >
16 >
17 I'll try it out.
18 However, as bash doesn't know net syntax, I'd still have to go the
19 extra-mile for stuff such as extracting IP from the config_ variable,
20 when that also contains a netmask (e.g. CIDR notation or "netmask"
21 definition following the ip).
22 Amit

Replies

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