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
07-09-2010, 05:37 PM
James
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
07-11-2010, 07:22 AM
Amit Dor-Shifer
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
07-11-2010, 08:43 AM
Amit Dor-Shifer
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
07-11-2010, 09:46 AM
Mateusz Arkadiusz Mierzwinski
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).
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).
Programs written in c++/c are not inherently secure, the programmer
must make use of best practices using secure functions, etc.
--
Kyle
07-11-2010, 05:59 PM
Alan McKinnon
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
07-13-2010, 02:11 AM
Iain Buchanan
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)