7eb9d00360
Making use of the apt-check command from the 'update-notifier-common' package (if available) display the number of available updates, number of security updates as well as the update package names.
9 lines
286 B
Ruby
9 lines
286 B
Ruby
Facter.add("apt_updates") do
|
|
confine :osfamily => 'Debian'
|
|
setcode do
|
|
if File.executable?("/usr/lib/update-notifier/apt-check")
|
|
updates = Facter::Util::Resolution.exec('/usr/lib/update-notifier/apt-check 2>&1')
|
|
Integer(updates.strip.split(';')[0])
|
|
end
|
|
end
|
|
end
|