[ale] Pulling IP address from server.

Jim Kinney jim.kinney at gmail.com
Mon Jul 27 12:05:21 EDT 2009


ifconfig will serve up what the system is using as it's IP address.
That's an excellent source for the data. Second source are the system
specific config files. If dhcp then ifconfig is only reliable source.

language changes should have little effect but to be safe use "export
LANG='C'; /sbin/ifconfig |..." to get data in a consistent manner.

On Mon, Jul 27, 2009 at 11:36 AM, Atlanta Geek<atlantageek at gmail.com> wrote:
> What is the best way to identify the server's IP address from
> ruby/perl/python/C.
> I found a chunk of code parsing the results of ifconfig and I'm always
> concerned when I see this type of thing.
>
> Also does changing the default language of a server affect the output
> of these commands at all.
>
> --
> http://www.atlantageek.com
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
>



-- 
-- 
James P. Kinney III
Actively in pursuit of Life, Liberty and Happiness


More information about the Ale mailing list