]> git.proxmox.com Git - mirror_acme.sh.git/commitdiff
fix https://github.com/acmesh-official/acme.sh/issues/2888
authorneil <github@byneil.com>
Wed, 29 Apr 2020 02:19:35 +0000 (10:19 +0800)
committerneil <github@byneil.com>
Wed, 29 Apr 2020 02:19:35 +0000 (10:19 +0800)
dnsapi/dns_cf.sh

index 8d2e23ba6879b10b1e66b19f6e11f56e00684735..652c37691a6dcf65a3c66aab6fbd01297cbbd49d 100755 (executable)
@@ -120,7 +120,7 @@ dns_cf_rm() {
   if [ "$count" = "0" ]; then
     _info "Don't need to remove."
   else
   if [ "$count" = "0" ]; then
     _info "Don't need to remove."
   else
-    record_id=$(printf "%s\n" "$response" | _egrep_o "\"id\":\"[^\"]*\"" | cut -d : -f 2 | tr -d \" | head -n 1)
+    record_id=$(echo "$response" | _egrep_o "\"id\": *\"[^\"]*\"" | cut -d : -f 2 | tr -d \" | _head_n 1)
     _debug "record_id" "$record_id"
     if [ -z "$record_id" ]; then
       _err "Can not get record id to remove."
     _debug "record_id" "$record_id"
     if [ -z "$record_id" ]; then
       _err "Can not get record id to remove."