count fails

This commit is contained in:
Sándor 2024-02-23 20:29:05 +01:00
parent afbed48118
commit 202093d693
1 changed files with 3 additions and 3 deletions

View File

@ -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