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() ]).decode().splitlines()
for item in result: for item in result:
if item.startswith(';;'): if item.startswith(';;'):
msgs.append('{} - {}'.format( continue
blocklist, msgs.append('{} listed in {} as {}'.format(
item, ip,
)) blocklist,
else: item,
msgs.append('{} listed in {} as {}'.format( ))
ip, if item in warn_ips and returncode < 2:
blocklist,
item,
))
if (item in warn_ips or item.startswith(';;')) and returncode < 2:
returncode = 1 returncode = 1
else: else:
returncode = 2 returncode = 2