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!"