Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
The method that I pointed out in the addendum to my first post in this thread *should* suffice if you are wanting to resolve the default external IP address of the machine - But I do agree, there is a great amount of 'grey area' on this question given the number of available configurations and methods of interface.

I don't however agree with the concept of parsing /etc/sysconfig/network-scripts/ifcfg-* - For starters, this is very much a Red Hat (and variant) locale for network configurations, *not* a general *NIX location pragma. Further to this, the idea of relying on text files generated outside of the real scope of the program makes me very nervous - I have rambled on this concept previously and as such won't repeat myself here.

Suffice to say, if you are going to rely on *any* external source, consider it tainted and evil (-T, -T and -T) until proven otherwise - And even then treat it with care. If I had to rely on an external program source, then I would be looking directly at /sbin/ifconfig (the path of which should be hard-coded into the program, not drawn from an alternate configuration file) and parsing the output of that.

Just my random thoughts on the matter

 

Ooohhh, Rob no beer function well without!


In reply to Re: Re:**3 (rob_au) Getting net addy on localhost? by rob_au
in thread Getting net addy on localhost? by r.joseph

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-25 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found