On Nov 14, 2006, at 11:47 AM, Erik Hollensbe wrote:
On Nov 14, 2006, at 11:23 AM, Aaron Johnson wrote:
Hello --
Is there an operating system independent way in ruby to determine the
IP address currently bound to any local ethernet interface? I would
like a way to find it that does not require DNS lookup or any network
query for that matter. The equivalent of 'ifconfig' for unix and
'ipconfig' for windows wrapped up into one line of ruby that doesn't
use system(). This would help with some cross platform server
deployment issues.
I have attached a script which for the most part does that. It's
intended for the "Puppet" project but still needs a lot of work
(and a clear integration plan) to fill in loose gaps.
Cripes. Not to ramble on about this, but you'll need the 'facter' gem
to use this script. In fact, if you only have one IP/Interface on the
box 'facter' may be all that you need.
--
Erik Hollensbe
[EMAIL PROTECTED]
_______________________________________________
PDXRuby mailing list
[email protected]
IRC: #pdx.rb on irc.freenode.net
http://lists.pdxruby.org/mailman/listinfo/pdxruby