From: MegaBrutal Date: Tue, 30 Sep 2025 23:00:00 +0000 (+0200) Subject: check-blacklist.sh: Another fix for false positives X-Git-Url: http://git.megabrutal.com/?a=commitdiff_plain;ds=sidebyside;p=mgsautils.git check-blacklist.sh: Another fix for false positives Seems like the previous attempt was not enough to fix all cases of false positives. Now ignore DiG comment lines (errors) altogether. modified: host/check-blacklist.sh --- diff --git a/host/check-blacklist.sh b/host/check-blacklist.sh index a00e018..0be8ad7 100755 --- a/host/check-blacklist.sh +++ b/host/check-blacklist.sh @@ -12,7 +12,7 @@ fi if ip=$(dig a "$1" +short) && [ -n "$ip" ] then - bl=$(dig a "$(printf "%s." "$ip" | tac -s.)$2" +short) \ + bl=$(dig a "$(printf "%s." "$ip" | tac -s.)$2" +short | grep -v "^;; ") \ && [ -n "$bl" ] && { echo "$ip is blacklisted ($bl)."; exit 1; } || echo "$ip is not blacklisted." else echo "Could not resolve $1!"