Browse Source

Fetch object with _egrep_o function

pull/3507/head
Komang Suryadana 5 years ago
parent
commit
ae2fe2562b
  1. 5
      dnsapi/dns_cloudns.sh

5
dnsapi/dns_cloudns.sh

@ -149,10 +149,9 @@ _dns_cloudns_get_zone_info() {
zone=$1 zone=$1
_dns_cloudns_http_api_call "dns/get-zone-info.json" "domain-name=$zone" _dns_cloudns_http_api_call "dns/get-zone-info.json" "domain-name=$zone"
if ! _contains "$response" "\"status\":\"Failed\""; then if ! _contains "$response" "\"status\":\"Failed\""; then
DOMAIN_TYPE=$(echo "$response" | tr ',' "\n" | grep -E '^"type"' | sed -re 's/^\"type\"\:\"([a-z]+)\"$/\1/g')
DOMAIN_TYPE=$(echo "$response" | _egrep_o '"type":"[^"]*"' | cut -d : -f 2 | tr -d '"')
if _contains "$DOMAIN_TYPE" "cloud"; then if _contains "$DOMAIN_TYPE" "cloud"; then
DOMAIN_MASTER=$(echo "$response" | tr ',' "\n" | grep -E '^"cloud-master"' | sed -re 's/^\"cloud-master\"\:\"([a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}+)\"}$/\1/g'
)
DOMAIN_MASTER=$(echo "$response" | _egrep_o '"cloud-master":"[^"]*"' | cut -d : -f 2 | tr -d '"')
fi fi
fi fi
return 0 return 0

Loading…
Cancel
Save