]> git.proxmox.com Git - mirror_acme.sh.git/commitdiff
Merge pull request #4266 from skyksandr/master
authorneil <github@neilpang.com>
Fri, 3 Feb 2023 08:49:26 +0000 (16:49 +0800)
committerGitHub <noreply@github.com>
Fri, 3 Feb 2023 08:49:26 +0000 (16:49 +0800)
Vultr DNS: fix "grep: repetition-operator operand invalid" on FreeBSD

dnsapi/dns_vultr.sh

index 58f14be10a13e2deaa62dad905fde6cbb9f87b76..54e5b6ce30052761126d6c14a3eb1e98a7afa3cd 100644 (file)
@@ -78,7 +78,7 @@ dns_vultr_rm() {
     return 1
   fi
 
-  _record_id="$(echo "$response" | tr '{}' '\n' | grep '"TXT"' | grep -- "$txtvalue" | tr ',' '\n' | grep -i 'id' | cut -d : -f 2)"
+  _record_id="$(echo "$response" | tr '{}' '\n' | grep '"TXT"' | grep -- "$txtvalue" | tr ',' '\n' | grep -i 'id' | cut -d : -f 2 | tr -d '"')"
   _debug _record_id "$_record_id"
   if [ "$_record_id" ]; then
     _info "Successfully retrieved the record id for ACME challenge."
@@ -116,7 +116,7 @@ _get_root() {
       return 1
     fi
 
-    if printf "%s\n" "$response" | grep '^\{.*\}' >/dev/null; then
+    if printf "%s\n" "$response" | grep -E '^\{.*\}' >/dev/null; then
       if _contains "$response" "\"domain\":\"$_domain\""; then
         _sub_domain="$(echo "$fulldomain" | sed "s/\\.$_domain\$//")"
         return 0