Date: 2007-04-11 17:49
Sender: Mark Uhrmacher
I found a small problem with this patch whereby it would attempt
to call arp on "127.0.0.1". Also, I added paths to
the executables since the user calling this tool didn't have
them by default.
Here are my changes:
if RUBY_PLATFORM =~ /solaris/
ifconfig_output = `/sbin/ifconfig -a`
ip_addresses = ifconfig_output.scan(/inet
(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/)
ip = ip_addresses.find {|addr| addr[0] != '127.0.0.1'}[0]
mac = `/usr/sbin/arp #{ip}`.split(' ')[3]
return mac |