Ver Fonte

dnsapi/pdns: also normalize json response in detecting root zone

manuel há 4 anos atrás
pai
commit
8636d3139e
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      dnsapi/dns_pdns.sh

+ 2 - 2
dnsapi/dns_pdns.sh

@@ -175,13 +175,13 @@ _get_root() {
   i=1
   i=1
 
 
   if _pdns_rest "GET" "/api/v1/servers/$PDNS_ServerId/zones"; then
   if _pdns_rest "GET" "/api/v1/servers/$PDNS_ServerId/zones"; then
-    _zones_response="$response"
+    _zones_response=$(echo "$response" | _normalizeJson)
   fi
   fi
 
 
   while true; do
   while true; do
     h=$(printf "%s" "$domain" | cut -d . -f $i-100)
     h=$(printf "%s" "$domain" | cut -d . -f $i-100)
 
 
-    if _contains "$_zones_response" "\"name\": \"$h.\""; then
+    if _contains "$_zones_response" "\"name\":\"$h.\""; then
       _domain="$h."
       _domain="$h."
       if [ -z "$h" ]; then
       if [ -z "$h" ]; then
         _domain="=2E"
         _domain="=2E"