Manual merge of abusehelper and abusesa from parameterize branch

This commit is contained in:
Ossi Salmi 2015-03-16 17:12:34 +02:00
parent f517230310
commit 09ae1aa84b
10 changed files with 501 additions and 354 deletions

View file

@ -1,15 +1,15 @@
Facter.add(:botnets) do
setcode do
botnets = []
if File.executable?("/usr/bin/botnet")
listcmd = "su -s /bin/sh - nobody -c '/usr/bin/botnet list'"
output = Facter::Util::Resolution.exec(listcmd)
output.each_line do |line|
if m = line.match(/^\[\d+\]\s+(.*\.py)/)
botnets << File.basename(File.dirname(m[1]))
end
end
setcode do
botnets = []
if File.executable?('/usr/bin/botnet')
listcmd = "su -s /bin/sh - nobody -c '/usr/bin/botnet list'"
output = Facter::Util::Resolution.exec(listcmd)
output.each_line do |line|
if m = line.match(/^\[\d+\]\s+(.*\.py)/)
botnets << File.basename(File.dirname(m[1]))
end
botnets.sort.join(',')
end
end
botnets.sort.join(',')
end
end