vérifier si une adresse ip est blacklistée

#!/bin/sh

declare -A blackliste=(
['b.barracudacentral.org']="http://barracudacentral.org/rbl/removal-request"
['bl.spamcannibal.org']="http://spamcannibal.org/cannibal.cgi"
['bl.spamcop.net']="https://www.spamcop.net/bl.shtml"
['cbl.abuseat.org']="https://www.abuseat.org/lookup.cgi"
['dnsbl-1.uceprotect.net']="http://www.uceprotect.net/en/rblcheck.php"
['dnsbl-2.uceprotect.net']="http://www.uceprotect.net/en/rblcheck.php"
['dnsbl-3.uceprotect.net']="http://www.uceprotect.net/en/rblcheck.php"
['dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support"
['dul.dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support"
['dyna.spamrats.com']="http://spamrats.com/removal.php"
['http.dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support"
['ips.backscatterer.org']="http://www.backscatterer.org/?target=test"
['misc.dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support"
['noptr.spamrats.com']="http://spamrats.com/removal.php"
['pbl.spamhaus.org']="https://www.spamhaus.org/pbl/"
['sbl.spamhaus.org']="https://www.spamhaus.org/sbl/"
['smtp.dnsbl.sorbs.net']=”http://www.sorbs.net/cgi-bin/support"
['socks.dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support"
['spam.abuse.ch']="https://abuse.ch/"
['spam.dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support"
['spam.spamrats.com']="http://spamrats.com/removal.php"
['ubl.lashback.com'’]="https://blacklist.lashback.com/"
['web.dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support"
['wormrbl.imp.ch']="http://imp.ch"
['xbl.spamhaus.org']="https://www.spamhaus.org/xbl/"
['zen.spamhaus.org']="https://www.spamhaus.org/zen/"
['zombie.dnsbl.sorbs.net']="http://www.sorbs.net/cgi-bin/support")

read -p 'Veuillez entrer votre ip: ' ip
adip=$ip;

if test -n "$adip"
then
echo -e "\n"

if echo "$(host $adip)" | grep found >/dev/null 2>&1;
then
echo "Aucun reverse DNS disponible, merci de verifier votre adresse IP";
exit 1;
else

adresseip=`host $adip | awk '{print $1}' | sed -e "s/\.in-addr.arpa//g"`;
for liste in ${!blackliste[@]};
do
digres=`dig +short -t a "$adresseip.$liste."` >/dev/null 2>&1;
if test -n "$digres"
then
echo "*****************************************************************";
echo -e "Votre adresse ip $adip est blacklistee chez $liste";
echo -e "Lien: ${blackliste[“$liste”]}";
echo "*****************************************************************";
echo -e "\n"
fi;
done;
fi;

else
exit
fi