From 1b25c70fc5b8c99a314aee4757833943e204129d Mon Sep 17 00:00:00 2001 From: Gustavo Arnosti Neves Date: Thu, 6 Sep 2018 19:20:10 -0300 Subject: [PATCH] Updated ID retrieval from response Tested calls with a response string and it was not extracting the ID. Used @wilddom's fork ID parsing and it works. Did not include get_root again as he did ($_domain_name comes with appropriate string). His fork: https://github.com/wilddom/acme.sh/commit/931f93c5bbf9ceed6ce636120fc7d8fad774b2e7 Only thing I wanted now was to disable/fix the `get_root` so it does not use the main domain when it fails on a subdomain. For example, if it fails on sub.domain.com it will try with domain.com and since I have both on Dynu, I don't really want that (I want it to just fail and then try again later). I guess I will open an issue for that... --- dnsapi/dns_dynu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnsapi/dns_dynu.sh b/dnsapi/dns_dynu.sh index ab3f54b0..8eec9b58 100644 --- a/dnsapi/dns_dynu.sh +++ b/dnsapi/dns_dynu.sh @@ -161,7 +161,7 @@ _get_recordid() { return 0 fi - _dns_record_id=$(printf "%s" "$response" | _egrep_o "{[^}]*}" | grep "\"text_data\":\"$txtvalue\"" | _egrep_o ",[^,]*," | grep ',"id":' | tr -d ",," | cut -d : -f 2) + _dns_record_id=$(printf "%s" "$response" | sed -e 's/[^{]*\({[^}]*}\)[^{]*/\1\n/g' | grep "\"text_data\":\"$txtvalue\"" | sed -e 's/.*"id":\([^,]*\).*/\1/') return 0 }