Browse Source

fixup! [FIX] Delete all occurrences of TXT key, dont fail if there is more than one, [FIX] Respect pagination on domain listing, before only the first page was loaded

Tom Blauwendraat 6 years ago
parent
commit
4a18c45e4f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      dnsapi/dns_dgon.sh

+ 2 - 2
dnsapi/dns_dgon.sh

@@ -105,7 +105,7 @@ dns_dgon_rm() {
   GURL="https://api.digitalocean.com/v2/domains/$_domain/records"
   GURL="https://api.digitalocean.com/v2/domains/$_domain/records"
 
 
   ## Get all the matching records
   ## Get all the matching records
-  while [ true ]; do
+  while true; do
     ## 1) get the URL
     ## 1) get the URL
     ## the create request - get
     ## the create request - get
     ## args: URL, [onlyheader, timeout]
     ## args: URL, [onlyheader, timeout]
@@ -128,7 +128,7 @@ dns_dgon_rm() {
       rec_ids="$(echo "$record" | _egrep_o "id\"\s*\:\s*\"*[0-9]+" | _egrep_o "[0-9]+")"
       rec_ids="$(echo "$record" | _egrep_o "id\"\s*\:\s*\"*[0-9]+" | _egrep_o "[0-9]+")"
       _debug rec_ids "$rec_ids"
       _debug rec_ids "$rec_ids"
       if [ ! -z "$rec_ids" ]; then
       if [ ! -z "$rec_ids" ]; then
-        echo "$rec_ids" | while IFS= read -r rec_id ; do
+        echo "$rec_ids" | while IFS= read -r rec_id; do
           ## delete the record
           ## delete the record
           ## delete URL for removing the one we dont want
           ## delete URL for removing the one we dont want
           DURL="https://api.digitalocean.com/v2/domains/$_domain/records/$rec_id"
           DURL="https://api.digitalocean.com/v2/domains/$_domain/records/$rec_id"