This commit is contained in:
Bxio 2025-06-23 17:47:11 +01:00
parent e45f612f7a
commit 7b81f5a1ea

View File

@ -45,12 +45,12 @@ for country in $COUNTRIES; do #https://www.ipdeny.com/ipblocks/data/countries/${
target_file="${ZONE_DIR}/${country}.zone" target_file="${ZONE_DIR}/${country}.zone"
if curl -sSf -o "$tmp_file" "$url"; then if curl -sSf -o "$tmp_file" "$url"; then
if [ -f "$target_file" ] && cmp -s "$tmp_file" "$target_file"; then grep -Eo '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+(/[0-9]+)?$' "$tmp_file" > "$target_file"
echo "[$country] Arquivo inalterado."
rm "$tmp_file" rm "$tmp_file"
else if [ ! -s "$target_file" ]; then
echo "[$country] Atualizando IPs." echo "[$country] Lista filtrada vazia, ignorando atualização."
mv "$tmp_file" "$target_file" rm "$target_file"
continue
fi fi
else else
echo "[$country] Falha no download. Mantendo antigo (se existir)." echo "[$country] Falha no download. Mantendo antigo (se existir)."