]> git.proxmox.com Git - mirror_acme.sh.git/commitdiff
Rackspace changed their API response, fixed the sed matching
authorTom Cocca <tcocca@propertybase.com>
Thu, 23 Sep 2021 12:10:17 +0000 (08:10 -0400)
committerTom Cocca <tcocca@propertybase.com>
Thu, 23 Sep 2021 12:10:17 +0000 (08:10 -0400)
dnsapi/dns_rackspace.sh

index 03e1fa686ef2ed56177ad5c2df4f754d82b4959b..9c9671825203f07f4871ceadcbc44189ef9dfd8f 100644 (file)
@@ -7,6 +7,7 @@
 
 RACKSPACE_Endpoint="https://dns.api.rackspacecloud.com/v1.0"
 
+# 20210923 - RS changed the fields in the API response; fix sed
 # 20190213 - The name & id fields swapped in the API response; fix sed
 # 20190101 - Duplicating file for new pull request to dev branch
 # Original - tcocca:rackspace_dnsapi https://github.com/acmesh-official/acme.sh/pull/1297
@@ -79,8 +80,8 @@ _get_root_zone() {
     _debug2 response "$response"
     if _contains "$response" "\"name\":\"$h\"" >/dev/null; then
       # Response looks like:
-      #   {"ttl":300,"accountId":12345,"id":1111111,"name":"example.com","emailAddress": ...<and so on>
-      _domain_id=$(echo "$response" | sed -n "s/^.*\"id\":\([^,]*\),\"name\":\"$h\",.*/\1/p")
+      #   {"id": "12345","accountId": "1111111","name": "example.com","ttl": 3600,"emailAddress": ...<and so on>
+      _domain_id=$(echo "$response" | sed -n "s/^.*\"id\":\"\([^,]*\)\",\"accountId\":\"[0-9]*\",\"name\":\"$h\",.*/\1/p")
       _debug2 domain_id "$_domain_id"
       if [ -n "$_domain_id" ]; then
         _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)