On Jul 3, 2007, at 12:28 PM, Jeff Barczewski wrote:

>
>
> Yes, it is not in my user path for gentoo linux either. It is in  
> my /sbin
> directory which my non-admin users don't normally have in their path.
>


latest version.  can everyone test on various platforms and report  
results and/or patch?

     def mac_address
       return @mac_address if defined? @mac_address
       re = %r/[^:\-](?:[0-9A-Za-z][0-9A-Za-z][:\-]){5}[0-9A-Za-z] 
[0-9A-Za-z][^:\-]/o
       lines = nil
       cmds = '/sbin/ifconfig', '/bin/ifconfig', 'ifconfig',  
'ipconfig /all'

       cmds.each do |cmd|
         stdout = IO.popen('ifconfig'){|fd| fd.readlines}
         next unless stdout and stdout.size > 0
         lines = stdout and break
       end
       raise 'ifconfig failed' unless lines

       candidates = lines.select{|line| line =~ re}
       raise 'no mac address candidates' unless candidates.first

       maddr = candidates.first[re]
       raise 'no mac address found' unless maddr
       @mac_address = maddr.strip
     end

i promise to post this when we're done so we all have it.

kind regards.


-a
--
we can deny everything, except that we have the possibility of being  
better. simply reflect on that.
h.h. the 14th dalai lama