]> git.proxmox.com Git - mirror_acme.sh.git/commitdiff
Fix Route53 API consumer
authorMarcello Barnaba <vjt@openssl.it>
Sun, 4 Dec 2016 19:10:33 +0000 (20:10 +0100)
committerMarcello Barnaba <vjt@openssl.it>
Sun, 4 Dec 2016 19:15:48 +0000 (20:15 +0100)
Ignoring the Chthlulu argument :smiley:, Route53 returns its XML all on one line, making not possible to grep the hosted zone record with egrep/sed.

This change splits the XML in multiple lines, so that parsing can succeed.

dnsapi/dns_aws.sh

index 15bf7b14e93d2e838e564ced86e33d1ba43b8373..2c58754daf2351e9a767fc36f0b681617c83557f 100644 (file)
@@ -72,7 +72,7 @@ _get_root() {
       fi
 
       if _contains "$response" "<Name>$h.</Name>"; then
-        hostedzone="$(echo "$response" | _egrep_o "<HostedZone>.*<Name>$h.</Name>.*</HostedZone>")"
+        hostedzone="$(echo "$response" | sed 's/<HostedZone>/\n&/g' | _egrep_o "<HostedZone>.*<Name>$h.</Name>.*</HostedZone>")"
         _debug hostedzone "$hostedzone"
         if [ -z "$hostedzone" ]; then
           _err "Error, can not get hostedzone."