]> git.proxmox.com Git - mirror_acme.sh.git/blobdiff - dnsapi/dns_curanet.sh
fix: fix shellcheck
[mirror_acme.sh.git] / dnsapi / dns_curanet.sh
index d446c64af78b8277d1abf7e6454f5b07e58423ee..4b39f36508a3ec0be6e9aa0cf9a4043627b30f79 100644 (file)
@@ -95,6 +95,14 @@ dns_curanet_rm() {
   fi
 
   recordid=$(echo "$response" | _egrep_o "{\"id\":[0-9]+,\"name\":\"$fulldomain\",\"type\":\"TXT\",\"ttl\":60,\"priority\":0,\"data\":\"..$txtvalue" | _egrep_o "id\":[0-9]+" | cut -c 5-)
+
+  if [ -z "$recordid" ]; then
+    _err "Unable to get recordid"
+    _debug "regex {\"id\":[0-9]+,\"name\":\"$fulldomain\",\"type\":\"TXT\",\"ttl\":60,\"priority\":0,\"data\":\"..$txtvalue"
+    _debug "response $response"
+    return 1
+  fi
+
   _debug "Deleting recordID $recordid"
   response="$(_post "" "$CURANET_REST_URL/${_domain}/Records/$recordid" "" "DELETE")"
   return 0
@@ -115,6 +123,8 @@ _get_token() {
     return 1
   fi
 
+  return 0
+
 }
 
 #_acme-challenge.www.domain.com