diff --git a/start.sh b/start.sh index 707004f..a5fd964 100644 --- a/start.sh +++ b/start.sh @@ -67,5 +67,12 @@ for country in $COUNTRIES; do iptables -t raw -I PREROUTING -m set --match-set "$country" src -j DROP fi + if iptables -t raw -C OUTPUT -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 OUTPUT -m set --match-set "$country" src -j DROP + fi + echo "Regra iptables configurada para o país $country." done