Merge pull request #4568 from imlonghao/patch-1

fix(cloudns): fix grep when TXT record start with hyphen symbol
This commit is contained in:
neil 2023-03-29 14:39:32 +08:00 committed by GitHub
commit 69e7360cc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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