From d250f9c715dd671a2d14066b184779cbd50b59d3 Mon Sep 17 00:00:00 2001 From: neil Date: Mon, 29 Feb 2016 22:42:26 +0800 Subject: [PATCH] fix bug for cloudflare api --- dnsapi/dns-cf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnsapi/dns-cf.sh b/dnsapi/dns-cf.sh index da5bef7..159969d 100755 --- a/dnsapi/dns-cf.sh +++ b/dnsapi/dns-cf.sh @@ -103,7 +103,7 @@ _get_root() { fi 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 _sub_domain=$(printf $domain | cut -d . -f 1-$p) _domain=$h