This commit is contained in:
parent
7bb79c2aa4
commit
8af6620fb7
22
start.sh
22
start.sh
@ -44,19 +44,19 @@ for country in $COUNTRIES; do #https://www.ipdeny.com/ipblocks/data/countries/${
|
|||||||
tmp_file="${ZONE_DIR}/${country}.zone.tmp"
|
tmp_file="${ZONE_DIR}/${country}.zone.tmp"
|
||||||
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"
|
if [ ! -s "$target_file" ]; then
|
||||||
else
|
echo "[$country] Lista filtrada vazia, ignorando atualização."
|
||||||
echo "[$country] Atualizando IPs."
|
rm "$target_file"
|
||||||
mv "$tmp_file" "$target_file"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "[$country] Falha no download. Mantendo antigo (se existir)."
|
|
||||||
[ -f "$tmp_file" ] && rm "$tmp_file"
|
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "[$country] Falha no download. Mantendo antigo (se existir)."
|
||||||
|
[ -f "$tmp_file" ] && rm "$tmp_file"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
if ipset list "$country" &>/dev/null; then
|
if ipset list "$country" &>/dev/null; then
|
||||||
echo "[$country] Limpando ipset antigo..."
|
echo "[$country] Limpando ipset antigo..."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user