add debug for blacklist

This commit is contained in:
2023-03-18 21:00:40 +01:00
parent 34076c243e
commit f258895234
2 changed files with 12 additions and 2 deletions

View File

@@ -47,9 +47,14 @@ do
echo ${j} >> ${BLACKLIST}
/usr/sbin/iptables -A BLACKLIST -s ${j} -j DROP
done
for j in ${list_sender}
for j in ${list_sender[@]}
do
scp -i /home/valentin/.ssh-blacklist/id_rsa -P ${SSH} ${BLACKLIST} blacklist_user@${j}:/tmp/blacklist_${IP}
echo "Blacklist envoye a ${j}" >> ${MAIL}
echo "scp -i /home/valentin/.ssh-blacklist/id_rsa -P ${SSH} ${BLACKLIST} blacklist_user@${j}:/tmp/blacklist_${IP}" >> ${MAIL}
scp -i /home/valentin/.ssh-blacklist/id_rsa -P ${SSH} ${BLACKLIST} blacklist_user@${j}:/tmp/blacklist_${IP}i
if [ ${?} -ne 0 ]; then
echo "Error SCP for ${j}" >> ${MAIL}
fi
done
echo "IP dejà blacklisté : " >> ${MAIL}
cat ${BLACKLIST} >> ${MAIL}