From b9e2ada1234e508a34b76c1285d1e36d04a70987 Mon Sep 17 00:00:00 2001 From: Bxio Date: Mon, 23 Jun 2025 18:12:11 +0100 Subject: [PATCH] --- start.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/start.sh b/start.sh index e5bd8b3..0040640 100644 --- a/start.sh +++ b/start.sh @@ -63,6 +63,10 @@ for country in $COUNTRIES; do #https://www.ipdeny.com/ipblocks/data/countries/${ continue fi +done + +for country in $COUNTRIES; do + if ipset list "$country" &>/dev/null; then echo "[$country] Limpando ipset antigo..." ipset destroy "$country" @@ -75,10 +79,12 @@ for country in $COUNTRIES; do #https://www.ipdeny.com/ipblocks/data/countries/${ while read -r subnet; do ipset add "$country" "$subnet" -exist || echo "Falha ao adicionar: $subnet" done < "$target_file" - - add_iptables_rule PREROUTING "$country" - - echo "[$country] Proteção configurada." done +for country in $COUNTRIES; do + add_iptables_rule PREROUTING "$country" +done + echo "[$country] Proteção configurada." + + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Proteção geográfica concluída!"