summaryrefslogtreecommitdiffstats
path: root/lib/facter/iphostnumber.rb
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-05-17 00:32:34 +1000
committerJames Turnbull <james@lovedthanlost.net>2008-05-17 00:32:34 +1000
commite02b0b386ed84384daeb2da0879bf215cfcfa2ef (patch)
tree36cdd5c3cc6143ce6faccb87ba6461bf5f481a29 /lib/facter/iphostnumber.rb
parent9c91a6d3fb9da933d8e1ba4149ee1b5587e6b007 (diff)
downloadfacter-e02b0b386ed84384daeb2da0879bf215cfcfa2ef.tar.gz
facter-e02b0b386ed84384daeb2da0879bf215cfcfa2ef.tar.xz
facter-e02b0b386ed84384daeb2da0879bf215cfcfa2ef.zip
Updated version. Moved most facts to seperate files.
Diffstat (limited to 'lib/facter/iphostnumber.rb')
-rw-r--r--lib/facter/iphostnumber.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/facter/iphostnumber.rb b/lib/facter/iphostnumber.rb
new file mode 100644
index 0000000..68b1c97
--- /dev/null
+++ b/lib/facter/iphostnumber.rb
@@ -0,0 +1,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