Facter::Util::Macaddress::Darwin

Public Class Methods

default_interface() click to toggle source
    # File lib/facter/util/macaddress.rb, line 19
19:     def self.default_interface
20:       `#{netstat_command} | /usr/bin/awk  '/^default/{print $6;exit}'`.chomp
21:     end
macaddress() click to toggle source
    # File lib/facter/util/macaddress.rb, line 11
11:     def self.macaddress
12:       iface = default_interface
13:       Facter.warn "Could not find a default route. Using first non-loopback interface" if iface.empty?
14: 
15:       macaddress = `#{ifconfig_command} #{iface} | /usr/bin/awk '/ether/{print $2;exit}'`.chomp
16:       macaddress.empty? ? nil : macaddress
17:     end

Private Class Methods

ifconfig_command() click to toggle source
    # File lib/facter/util/macaddress.rb, line 29
29:     def self.ifconfig_command
30:       '/sbin/ifconfig'
31:     end
netstat_command() click to toggle source
    # File lib/facter/util/macaddress.rb, line 25
25:     def self.netstat_command
26:       '/usr/sbin/netstat -rn'
27:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.