summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/facter/ekeyd.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/facter/ekeyd.rb b/lib/facter/ekeyd.rb
index 5a4417c..f15a304 100644
--- a/lib/facter/ekeyd.rb
+++ b/lib/facter/ekeyd.rb
@@ -1,5 +1,11 @@
Facter.add('ekeyd_key_present') do
- confine :kernel => %w{Linux}
+ setcode do
+ FileTest.exists?('/proc/bus/usb/devices') && \
+ !(File.read('/proc/bus/usb/devices') =~ /Product=Entropy Key/).nil?
+ end
+end
+Facter.add('ekeyd_key_present') do
+ confine :operatingsystem => %w{Debian}
setcode do
!`lsusb | grep "Entropy Key"`.empty?
end