From b293d0c01bf5b905d6f2bf1c1ef4a913bfa96f64 Mon Sep 17 00:00:00 2001 From: Bxio Date: Mon, 23 Jun 2025 15:39:47 +0100 Subject: [PATCH] --- start.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/start.sh b/start.sh index 0331bd0..707004f 100644 --- a/start.sh +++ b/start.sh @@ -58,4 +58,14 @@ for country in $COUNTRIES; do done < "$target_file" echo "Concluído para o país $country." + + # Verifica se a regra iptables já existe + if iptables -t raw -C PREROUTING -m set --match-set "$country" src -j DROP 2>/dev/null; then + echo "Regra iptables para ipset '$country' já existe." + else + echo "Inserindo regra iptables para bloquear IPs do ipset '$country'..." + iptables -t raw -I PREROUTING -m set --match-set "$country" src -j DROP + fi + + echo "Regra iptables configurada para o país $country." done