summaryrefslogtreecommitdiff
path: root/lib/facter/root_home.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/facter/root_home.rb')
-rw-r--r--lib/facter/root_home.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/facter/root_home.rb b/lib/facter/root_home.rb
index 8249f7d..b4f87ff 100644
--- a/lib/facter/root_home.rb
+++ b/lib/facter/root_home.rb
@@ -17,3 +17,16 @@ end
Facter.add(:root_home) do
setcode { Facter::Util::RootHome.get_root_home }
end
+
+Facter.add(:root_home) do
+ confine :kernel => :darwin
+ setcode do
+ str = Facter::Util::Resolution.exec("dscacheutil -q user -a name root")
+ hash = {}
+ str.split("\n").each do |pair|
+ key,value = pair.split(/:/)
+ hash[key] = value
+ end
+ hash['dir'].strip
+ end
+end