Browse Source

fix bug for cloudflare api

neil 9 years ago
parent
commit
d250f9c715
1 changed files with 1 additions and 1 deletions
  1. 1 1
      dnsapi/dns-cf.sh

+ 1 - 1
dnsapi/dns-cf.sh

@@ -103,7 +103,7 @@ _get_root() {
     fi
     fi
     
     
     if printf $response | grep \"name\":\"$h\" ; then
     if printf $response | grep \"name\":\"$h\" ; then
-      _domain_id=$(printf $response | grep -o \"id\":\"[^\"]*\" | cut -d : -f 2 | tr -d \")
+      _domain_id=$(printf "$response" | grep -o \"id\":\"[^\"]*\" | head -1 | cut -d : -f 2 | tr -d \")
       if [ "$_domain_id" ] ; then
       if [ "$_domain_id" ] ; then
         _sub_domain=$(printf $domain | cut -d . -f 1-$p)
         _sub_domain=$(printf $domain | cut -d . -f 1-$p)
         _domain=$h
         _domain=$h