Przeglądaj źródła

fix: remove sed before grep, but lead to less robusty

Easton Man 4 lat temu
rodzic
commit
83a4db3b31
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      dnsapi/dns_huaweicloud.sh

+ 1 - 1
dnsapi/dns_huaweicloud.sh

@@ -144,7 +144,7 @@ _add_record() {
   response=$(_get "${dns_api}/v2/zones/${zoneid}/recordsets?name=${_domain}")
 
   _debug "${response}"
-  _exist_record=$(echo "${response}" | sed -e ':a' -e 'N;$!ba;' -e 's/\n/ /g' | _egrep_o '"records":[^]]*' | sed 's/\"records\"\:\[//g')
+  _exist_record=$(echo "${response}" | _egrep_o '"records":[^]]*' | sed 's/\"records\"\:\[//g')
   _debug "${_exist_record}"
 
   # Check if record exist