apt_updates.rb 286 B

123456789
  1. Facter.add("apt_updates") do
  2. confine :osfamily => 'Debian'
  3. setcode do
  4. if File.executable?("/usr/lib/update-notifier/apt-check")
  5. updates = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check 2>&1')
  6. Integer(updates.strip.split(';')[0])
  7. end
  8. end
  9. end