Sha256: f4ad30f44a2b966de1bb4b9e721195bd4f305590d47097fb2b2b0aff57a13c43
Contents?: true
Size: 628 Bytes
Versions: 36
Compression:
Stored size: 628 Bytes
Contents
# Fact: iphostnumber # # Purpose: On selected versions of Darwin, returns the host's IP address. # # Resolution: # Uses either the scutil program to get the localhost name, or parses output # of ifconfig for a MAC address. # # Caveats: # Facter.add(:iphostnumber) do confine :kernel => :darwin, :kernelrelease => "R6" setcode do %x{/usr/sbin/scutil --get LocalHostName} end end Facter.add(:iphostnumber) do confine :kernel => :darwin, :kernelrelease => "R6" setcode do ether = nil output = %x{/sbin/ifconfig} output =~ /HWaddr (\w\w:\w\w:\w\w:\w\w:\w\w:\w\w)/ ether = $1 ether end end
Version data entries
36 entries across 36 versions & 3 rubygems