1
0
Fork 0
mirror of https://github.com/tunix/digitalocean-dyndns synced 2024-05-18 05:33:38 +00:00

Add pagination link to get full list

This commit is contained in:
Alexey Matashkin 2019-06-26 23:07:59 +10:00 committed by GitHub
parent a3553daa2f
commit d06220a8ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,12 +13,13 @@ test -z $DOMAIN && die "DOMAIN not set!"
test -z $NAME && die "NAME not set!"
dns_list="$api_host/domains/$DOMAIN/records"
dns_list_long="$api_host/domains/$DOMAIN/records?per_page=200"
while ( true ); do
domain_records=$(curl -s -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
$dns_list)
$dns_list_long)
record_id=$(echo $domain_records| jq ".domain_records[] | select(.type == \"A\" and .name == \"$NAME\") | .id")
record_data=$(echo $domain_records| jq -r ".domain_records[] | select(.type == \"A\" and .name == \"$NAME\") | .data")