From 202093d693ae2269342b6259128198c08b7739cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ndor?= Date: Fri, 23 Feb 2024 20:29:05 +0100 Subject: [PATCH] count fails --- check_ptr.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_ptr.sh b/check_ptr.sh index 15b3489..c641ef7 100644 --- a/check_ptr.sh +++ b/check_ptr.sh @@ -14,14 +14,14 @@ fi IPS="$(dig +short $1 A | sort -u) $(dig +short $1 AAAA | sort -u)" # Loop through IPs +fails=0 for IP in $IPS; do # Performs the actual lookup against blacklists RESULT=$(host $IP | rev | cut -d" " -f1 | rev | sed 's/.$//') if [ "$RESULT" != "$1" ]; then - echo 1 - exit 0 + ((fails++)) fi done -echo 0 +echo $fails exit 0 \ No newline at end of file