bundles/icinga2: ignore lines starting with ;; in check_spam_blocklist

This commit is contained in:
Franzi 2024-09-04 18:56:48 +02:00
parent b73ac2b7ce
commit 3f02f7b8f5
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -50,17 +50,13 @@ def check_list(ip_list, blocklist, warn_ips):
]).decode().splitlines()
for item in result:
if item.startswith(';;'):
msgs.append('{} - {}'.format(
blocklist,
item,
))
else:
msgs.append('{} listed in {} as {}'.format(
ip,
blocklist,
item,
))
if (item in warn_ips or item.startswith(';;')) and returncode < 2:
continue
msgs.append('{} listed in {} as {}'.format(
ip,
blocklist,
item,
))
if item in warn_ips and returncode < 2:
returncode = 1
else:
returncode = 2