This commit is contained in:
parent
83acbe3e66
commit
e45f612f7a
10
start.sh
10
start.sh
@ -45,12 +45,12 @@ for country in $COUNTRIES; do #https://www.ipdeny.com/ipblocks/data/countries/${
|
||||
target_file="${ZONE_DIR}/${country}.zone"
|
||||
|
||||
if curl -sSf -o "$tmp_file" "$url"; then
|
||||
grep -Eo '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+(/[0-9]+)?$' "$tmp_file" > "$target_file"
|
||||
if [ -f "$target_file" ] && cmp -s "$tmp_file" "$target_file"; then
|
||||
echo "[$country] Arquivo inalterado."
|
||||
rm "$tmp_file"
|
||||
if [ ! -s "$target_file" ]; then
|
||||
echo "[$country] Lista filtrada vazia, ignorando atualização."
|
||||
rm "$target_file"
|
||||
continue
|
||||
else
|
||||
echo "[$country] Atualizando IPs."
|
||||
mv "$tmp_file" "$target_file"
|
||||
fi
|
||||
else
|
||||
echo "[$country] Falha no download. Mantendo antigo (se existir)."
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user