]> git.proxmox.com Git - mirror_acme.sh.git/commitdiff
fix(cloudns): fix grep when record start with hyphen symbol
authorimlonghao <git@imlonghao.com>
Tue, 28 Mar 2023 14:34:04 +0000 (22:34 +0800)
committerimlonghao <git@imlonghao.com>
Tue, 28 Mar 2023 14:49:39 +0000 (22:49 +0800)
dnsapi/dns_cloudns.sh

index b03fd5795bf570508ae496493916183235cd1db9..8d7fd437ebbb192734b9f584b771b595e6e3ae6d 100755 (executable)
@@ -78,7 +78,7 @@ dns_cloudns_rm() {
     return 1
   fi
 
-  for i in $(echo "$response" | tr '{' "\n" | grep "$record"); do
+  for i in $(echo "$response" | tr '{' "\n" | grep -- "$record"); do
     record_id=$(echo "$i" | tr ',' "\n" | grep -E '^"id"' | sed -re 's/^\"id\"\:\"([0-9]+)\"$/\1/g')
 
     if [ -n "$record_id" ]; then