* [gentoo-user] OT: tool for reading /etc/conf.d/net?
@ 2010-07-08 12:06 Amit Dor-Shifer
2010-07-08 12:13 ` [gentoo-user] " Remy Blank
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Amit Dor-Shifer @ 2010-07-08 12:06 UTC (permalink / raw
To: gentoo-user
Can anyone recommend a tool that can parse networking info from a/m
file, so one can use it to query, e.g. what is the static IP configured
on eth0?
Amit
^ permalink raw reply [flat|nested] 10+ messages in thread
* [gentoo-user] Re: OT: tool for reading /etc/conf.d/net?
2010-07-08 12:06 [gentoo-user] OT: tool for reading /etc/conf.d/net? Amit Dor-Shifer
@ 2010-07-08 12:13 ` Remy Blank
2010-07-11 8:43 ` Amit Dor-Shifer
2010-07-09 17:37 ` James
2010-07-13 2:11 ` [gentoo-user] " Iain Buchanan
2 siblings, 1 reply; 10+ messages in thread
From: Remy Blank @ 2010-07-08 12:13 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 383 bytes --]
Amit Dor-Shifer wrote:
> Can anyone recommend a tool that can parse networking info from a/m
> file, so one can use it to query, e.g. what is the static IP configured
> on eth0?
bash?
No, I'm not joking. The file is a bash script, and hence can just be
sourced by another bash script, which could then print the relevant
information in any desired format.
-- Remy
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 187 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [gentoo-user] Re: OT: tool for reading /etc/conf.d/net?
2010-07-08 12:06 [gentoo-user] OT: tool for reading /etc/conf.d/net? Amit Dor-Shifer
2010-07-08 12:13 ` [gentoo-user] " Remy Blank
@ 2010-07-09 17:37 ` James
2010-07-11 7:22 ` Amit Dor-Shifer
2010-07-13 2:11 ` [gentoo-user] " Iain Buchanan
2 siblings, 1 reply; 10+ messages in thread
From: James @ 2010-07-09 17:37 UTC (permalink / raw
To: gentoo-user
Amit Dor-Shifer <amitds <at> oversi.com> writes:
> Can anyone recommend a tool that can parse networking info from a/m
> file, so one can use it to query, e.g. what is the static IP configured
> on eth0?
> Amit
/sbin/ifconfig -a
???
if not, look at the iproute, netstat, etc etc
commands...
hth,
James
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-user] Re: OT: tool for reading /etc/conf.d/net?
2010-07-09 17:37 ` James
@ 2010-07-11 7:22 ` Amit Dor-Shifer
0 siblings, 0 replies; 10+ messages in thread
From: Amit Dor-Shifer @ 2010-07-11 7:22 UTC (permalink / raw
To: gentoo-user
On 07/09/10 20:37, James wrote:
> Amit Dor-Shifer<amitds<at> oversi.com> writes:
>
>
>
>> Can anyone recommend a tool that can parse networking info from a/m
>> file, so one can use it to query, e.g. what is the static IP configured
>> on eth0?
>> Amit
>>
> /sbin/ifconfig -a
>
>
> ???
>
> if not, look at the iproute, netstat, etc etc
> commands...
>
> hth,
> James
>
AFAIK, all those would only work once the interface is up. They don't
have the capability to just read cfg and emit what's there is some
usable form.
Amit
>
>
>
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-user] Re: OT: tool for reading /etc/conf.d/net?
2010-07-08 12:13 ` [gentoo-user] " Remy Blank
@ 2010-07-11 8:43 ` Amit Dor-Shifer
2010-07-11 9:46 ` Mateusz Arkadiusz Mierzwinski
0 siblings, 1 reply; 10+ messages in thread
From: Amit Dor-Shifer @ 2010-07-11 8:43 UTC (permalink / raw
To: gentoo-user
On 07/08/10 15:13, Remy Blank wrote:
> Amit Dor-Shifer wrote:
>
>> Can anyone recommend a tool that can parse networking info from a/m
>> file, so one can use it to query, e.g. what is the static IP configured
>> on eth0?
>>
> bash?
>
> No, I'm not joking. The file is a bash script, and hence can just be
> sourced by another bash script, which could then print the relevant
> information in any desired format.
>
> -- Remy
>
>
I'll try it out.
However, as bash doesn't know net syntax, I'd still have to go the
extra-mile for stuff such as extracting IP from the config_ variable,
when that also contains a netmask (e.g. CIDR notation or "netmask"
definition following the ip).
Amit
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-user] Re: OT: tool for reading /etc/conf.d/net?
2010-07-11 8:43 ` Amit Dor-Shifer
@ 2010-07-11 9:46 ` Mateusz Arkadiusz Mierzwinski
2010-07-11 9:48 ` Mateusz Arkadiusz Mierzwinski
0 siblings, 1 reply; 10+ messages in thread
From: Mateusz Arkadiusz Mierzwinski @ 2010-07-11 9:46 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]
Wrote one in C,C++, Bash, Java or even PHP CLI ?? Try some... :)
This file is Bash script. Every line comes with some portion of "variable =
variable data". It's realy simple. In PHP you can write simple script using
explode functions or regexp's.
Good luck
2010/7/11 Amit Dor-Shifer <amitds@oversi.com>
>
>
> On 07/08/10 15:13, Remy Blank wrote:
>
>> Amit Dor-Shifer wrote:
>>
>>
>>> Can anyone recommend a tool that can parse networking info from a/m
>>> file, so one can use it to query, e.g. what is the static IP configured
>>> on eth0?
>>>
>>>
>> bash?
>>
>> No, I'm not joking. The file is a bash script, and hence can just be
>> sourced by another bash script, which could then print the relevant
>> information in any desired format.
>>
>> -- Remy
>>
>>
>>
> I'll try it out.
> However, as bash doesn't know net syntax, I'd still have to go the
> extra-mile for stuff such as extracting IP from the config_ variable, when
> that also contains a netmask (e.g. CIDR notation or "netmask" definition
> following the ip).
> Amit
>
>
--
Mateusz Mierzwiński
Bluebox Software http://www.blueboxsoft.pl/mateusz-mierzwinski
[-- Attachment #2: Type: text/html, Size: 1907 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-user] Re: OT: tool for reading /etc/conf.d/net?
2010-07-11 9:46 ` Mateusz Arkadiusz Mierzwinski
@ 2010-07-11 9:48 ` Mateusz Arkadiusz Mierzwinski
2010-07-11 17:26 ` Kyle Bader
0 siblings, 1 reply; 10+ messages in thread
From: Mateusz Arkadiusz Mierzwinski @ 2010-07-11 9:48 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1573 bytes --]
Fastest way - dump into PHP, use some explodes and regexps.
Most secured - App i C++ or C.
Balanced Way - JAVA app :)
W dniu 11 lipca 2010 11:46 użytkownik Mateusz Arkadiusz Mierzwinski <
mateuszmierzwinski@gmail.com> napisał:
> Wrote one in C,C++, Bash, Java or even PHP CLI ?? Try some... :)
>
> This file is Bash script. Every line comes with some portion of "variable =
> variable data". It's realy simple. In PHP you can write simple script using
> explode functions or regexp's.
>
> Good luck
>
> 2010/7/11 Amit Dor-Shifer <amitds@oversi.com>
>
>
>>
>> On 07/08/10 15:13, Remy Blank wrote:
>>
>>> Amit Dor-Shifer wrote:
>>>
>>>
>>>> Can anyone recommend a tool that can parse networking info from a/m
>>>> file, so one can use it to query, e.g. what is the static IP configured
>>>> on eth0?
>>>>
>>>>
>>> bash?
>>>
>>> No, I'm not joking. The file is a bash script, and hence can just be
>>> sourced by another bash script, which could then print the relevant
>>> information in any desired format.
>>>
>>> -- Remy
>>>
>>>
>>>
>> I'll try it out.
>> However, as bash doesn't know net syntax, I'd still have to go the
>> extra-mile for stuff such as extracting IP from the config_ variable, when
>> that also contains a netmask (e.g. CIDR notation or "netmask" definition
>> following the ip).
>> Amit
>>
>>
>
>
> --
> Mateusz Mierzwiński
>
> Bluebox Software http://www.blueboxsoft.pl/mateusz-mierzwinski
>
--
Mateusz Mierzwiński
Bluebox Software http://www.blueboxsoft.pl/mateusz-mierzwinski
[-- Attachment #2: Type: text/html, Size: 2710 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-user] Re: OT: tool for reading /etc/conf.d/net?
2010-07-11 9:48 ` Mateusz Arkadiusz Mierzwinski
@ 2010-07-11 17:26 ` Kyle Bader
2010-07-11 17:59 ` Alan McKinnon
0 siblings, 1 reply; 10+ messages in thread
From: Kyle Bader @ 2010-07-11 17:26 UTC (permalink / raw
To: gentoo-user
> Most secured - App i C++ or C.
Programs written in c++/c are not inherently secure, the programmer
must make use of best practices using secure functions, etc.
--
Kyle
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-user] Re: OT: tool for reading /etc/conf.d/net?
2010-07-11 17:26 ` Kyle Bader
@ 2010-07-11 17:59 ` Alan McKinnon
0 siblings, 0 replies; 10+ messages in thread
From: Alan McKinnon @ 2010-07-11 17:59 UTC (permalink / raw
To: gentoo-user
On Sunday 11 July 2010 19:26:17 Kyle Bader wrote:
> > Most secured - App i C++ or C.
>
> Programs written in c++/c are not inherently secure, the programmer
> must make use of best practices using secure functions, etc.
Programs are not inherently secure, the programmer must make use of best
practices using secure functions, etc.
Yes, that's better. Much closer to the truth.
All languages are insecure, to about the same degree. The only difference is
the method of the attack vectors.
We use Von Neumann machines. "Inherently secure" is a pipe-dream with those
and will never exist.
--
alan dot mckinnon at gmail dot com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-user] OT: tool for reading /etc/conf.d/net?
2010-07-08 12:06 [gentoo-user] OT: tool for reading /etc/conf.d/net? Amit Dor-Shifer
2010-07-08 12:13 ` [gentoo-user] " Remy Blank
2010-07-09 17:37 ` James
@ 2010-07-13 2:11 ` Iain Buchanan
2 siblings, 0 replies; 10+ messages in thread
From: Iain Buchanan @ 2010-07-13 2:11 UTC (permalink / raw
To: gentoo-user
On Thu, 2010-07-08 at 15:06 +0300, Amit Dor-Shifer wrote:
> Can anyone recommend a tool that can parse networking info from a/m
> file, so one can use it to query, e.g. what is the static IP configured
> on eth0?
> Amit
>
I'm a bit slow in replying, but there's a Google SOC project to
integrate NetworkManager with Gentoo config files. Last time I looked
it seemed to be mostly working. There's a blog somewhere *looking*
http://qiaomuf.wordpress.com/
try that out. Don't think there's a command line interface to NM though
so don't know how your parsing will go...
--
Iain Buchanan <iaindb at netspace dot net dot au>
"It's God. No, not Richard Stallman, or Linus Torvalds, but God."
(By Matt Welsh)
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-07-13 2:12 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-08 12:06 [gentoo-user] OT: tool for reading /etc/conf.d/net? Amit Dor-Shifer
2010-07-08 12:13 ` [gentoo-user] " Remy Blank
2010-07-11 8:43 ` Amit Dor-Shifer
2010-07-11 9:46 ` Mateusz Arkadiusz Mierzwinski
2010-07-11 9:48 ` Mateusz Arkadiusz Mierzwinski
2010-07-11 17:26 ` Kyle Bader
2010-07-11 17:59 ` Alan McKinnon
2010-07-09 17:37 ` James
2010-07-11 7:22 ` Amit Dor-Shifer
2010-07-13 2:11 ` [gentoo-user] " Iain Buchanan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox