added acpi command test
authormh <mh@immerda.ch>
Sun, 22 Feb 2009 23:20:16 +0000 (23:20 +0000)
committermh <mh@immerda.ch>
Sun, 22 Feb 2009 23:20:16 +0000 (23:20 +0000)
plugins/facter/acpi_available.rb

index e3d8dfa..576d76c 100644 (file)
@@ -1,7 +1,7 @@
 # return whether acpi is available -- used for deciding whether to install the munin plugin
 Facter.add("acpi_available") do
        setcode do
-               if `acpi -t -B -A 2>/dev/null`.match(/\d/).nil? 
+               if not File.exist? `which acpi 2>/dev/null`.chomp or `acpi -t -B -A 2>/dev/null`.match(/\d/).nil? 
                        "absent"
                else
                        "present"