From b7addc2aee0cbcad853ae8515dc84b911ab5f651 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Tue, 7 Feb 2023 22:33:52 +0100 Subject: [PATCH] plus de detail dans le mail --- roles/deploy-web/files/blacklist.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/deploy-web/files/blacklist.sh b/roles/deploy-web/files/blacklist.sh index 4321bd0..d1d5f46 100755 --- a/roles/deploy-web/files/blacklist.sh +++ b/roles/deploy-web/files/blacklist.sh @@ -52,6 +52,8 @@ do echo ${i} >> ${MAIL} curl http://ipinfo.io/${i} >> ${MAIL} echo "" >> ${MAIL} + tail -n 50 $log_access | grep ${i} | awk -F "|" '{ if($2 == "400" || $2 == "404") print $0}' >> ${MAIL} + echo "" >> ${MAIL} echo ${i} >> ${BLACKLIST} done echo "IP dejà blacklisté : " >> ${MAIL}