This commit is contained in:
parent
8f67cf68cb
commit
b9e2ada123
14
start.sh
14
start.sh
@ -63,6 +63,10 @@ for country in $COUNTRIES; do #https://www.ipdeny.com/ipblocks/data/countries/${
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
for country in $COUNTRIES; do
|
||||||
|
|
||||||
if ipset list "$country" &>/dev/null; then
|
if ipset list "$country" &>/dev/null; then
|
||||||
echo "[$country] Limpando ipset antigo..."
|
echo "[$country] Limpando ipset antigo..."
|
||||||
ipset destroy "$country"
|
ipset destroy "$country"
|
||||||
@ -75,10 +79,12 @@ for country in $COUNTRIES; do #https://www.ipdeny.com/ipblocks/data/countries/${
|
|||||||
while read -r subnet; do
|
while read -r subnet; do
|
||||||
ipset add "$country" "$subnet" -exist || echo "Falha ao adicionar: $subnet"
|
ipset add "$country" "$subnet" -exist || echo "Falha ao adicionar: $subnet"
|
||||||
done < "$target_file"
|
done < "$target_file"
|
||||||
|
|
||||||
add_iptables_rule PREROUTING "$country"
|
|
||||||
|
|
||||||
echo "[$country] Proteção configurada."
|
|
||||||
done
|
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!"
|
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Proteção geográfica concluída!"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user