diff --git a/README.md b/README.md
@@ -7,7 +7,7 @@ Zone files are updated once every 24 hours, specifically from 00:00 UTC to 06:00
At the time of writing this repository, the CZDS offers access to 1,150 zones in total.
-1,079 have been approved, 55 are still pending *(after 3 months)*, 10 have been revoked because the TLDs are longer active, and 6 have been denied.
+1,079 have been approved, 55 are still pending *(after 3 months)*, 10 have been revoked because the TLDs are longer active, and 6 have been denied. Zones that have expired automatically had the expiration extended for me without doing anything, aside from 13 zones that remained expired.
## Usage
### Authentication
diff --git a/czds b/czds
@@ -23,13 +23,15 @@ download_zone() {
url="$1"
token="$2"
filename=$(basename "$url")
- filepath="zonefiles/$filename"
+ tld=$(echo "$filename" | cut -d '.' -f 1)
+ filepath="zonefiles/$tld.txt.gz"
+
# Create output directory if it does not exist
mkdir -p zonefiles
# Make the GET request and save the response to a file
- curl -s -o "$filepath" -H "Authorization: Bearer $token" "$url"
+ curl --progress-bar -o "$filepath" -H "Authorization: Bearer $token" "$url"
echo "Downloaded zone file to $filepath"
}
@@ -56,8 +58,10 @@ zone_links=$(curl -s -H "Authorization: Bearer $token" "https://czds-api.icann.o
# Download zone files
for url in $zone_links; do
- echo "Downloading $url..."
- download_zone "$url" "$token"
+ if [ ! -f $filepath ]; then
+ echo "Downloading $url..."
+ download_zone "$url" "$token"
+ fi
done
echo "All zone files downloaded."
| |