fix path iptables executable

This commit is contained in:
Valentin CZERYBA 2023-03-03 19:45:51 +01:00
parent 76deffe6f4
commit c1197dec5c

View File

@ -5,7 +5,7 @@ HOST=($(cat /etc/sentinel/virtualhost))
BLACKLIST=/etc/sentinel/blacklist BLACKLIST=/etc/sentinel/blacklist
chain_count=$(iptables -L BLACKLIST -n | wc -l) chain_count=$(/usr/sbin/iptables -L BLACKLIST -n | wc -l)
if [ ${chain_count} -eq 0 ]; then if [ ${chain_count} -eq 0 ]; then
bash /usr/local/bin/sentinel/refill_blacklist.sh bash /usr/local/bin/sentinel/refill_blacklist.sh
fi fi
@ -30,7 +30,7 @@ do
cat /tmp/error_$i | grep ${j} >> ${MAIL} cat /tmp/error_$i | grep ${j} >> ${MAIL}
echo "" >> ${MAIL} echo "" >> ${MAIL}
echo ${j} >> ${BLACKLIST} echo ${j} >> ${BLACKLIST}
iptables -A BLACKLIST -s ${j} -j DROP /usr/sbin/iptables -A BLACKLIST -s ${j} -j DROP
done done
echo "IP dejà blacklisté : " >> ${MAIL} echo "IP dejà blacklisté : " >> ${MAIL}
cat ${BLACKLIST} >> ${MAIL} cat ${BLACKLIST} >> ${MAIL}