FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 07-08-2010, 12:13 PM
Remy Blank
 
Default OT: tool for reading /etc/conf.d/net?

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
 
Old 07-09-2010, 05:37 PM
James
 
Default OT: tool for reading /etc/conf.d/net?

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
 
Old 07-11-2010, 07:22 AM
Amit Dor-Shifer
 
Default OT: tool for reading /etc/conf.d/net?

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
 
Old 07-11-2010, 08:43 AM
Amit Dor-Shifer
 
Default OT: tool for reading /etc/conf.d/net?

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
 
Old 07-11-2010, 09:46 AM
Mateusz Arkadiusz Mierzwinski
 
Default OT: tool for reading /etc/conf.d/net?

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
 
Old 07-11-2010, 09:48 AM
Mateusz Arkadiusz Mierzwinski
 
Default OT: tool for reading /etc/conf.d/net?

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
 
Old 07-11-2010, 05:26 PM
Kyle Bader
 
Default OT: tool for reading /etc/conf.d/net?

> 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
 
Old 07-11-2010, 05:59 PM
Alan McKinnon
 
Default OT: tool for reading /etc/conf.d/net?

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
 
Old 07-13-2010, 02:11 AM
Iain Buchanan
 
Default OT: tool for reading /etc/conf.d/net?

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)
 

Thread Tools




All times are GMT. The time now is 07:50 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ę2007 - 2008, www.linux-archive.org