summaryrefslogtreecommitdiffstats
path: root/lib/facter/iphostnumber.rb
blob: bc384325fe2b1b1e6b0017b13c9c7294bf21a2ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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