summaryrefslogtreecommitdiff
path: root/lib/facter/acpi_available.rb
blob: 9a0474f8974efd80b79413d14c0b07f3cc5f472a (plain)
1
2
3
4
5
6
7
8
9
10
# return whether acpi is available -- used for deciding whether to install the munin plugin
Facter.add("acpi_available") do
    setcode do
    	if not File.exist? `which acpi 2>/dev/null`.chomp or `acpi -t -B -A 2>/dev/null`.match(/\d/).nil?
    		"absent"
    	else
    		"present"
    	end
    end
end