From 01f54558b9ee70e88a248f1e284625106ae62ecb Mon Sep 17 00:00:00 2001 From: neil Date: Wed, 27 Apr 2016 23:34:29 +0800 Subject: [PATCH] fix error message. --- acme.sh | 9 +++++++-- dnsapi/dns_cf.sh | 2 +- dnsapi/dns_cx.sh | 2 +- dnsapi/dns_dp.sh | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/acme.sh b/acme.sh index fd29e322..e6985e93 100755 --- a/acme.sh +++ b/acme.sh @@ -1473,11 +1473,16 @@ issue() { _savedomainconf "Le_NextRenewTimeStr" "$Le_NextRenewTimeStr" - installcert $Le_Domain "$Le_RealCertPath" "$Le_RealKeyPath" "$Le_RealCACertPath" "$Le_ReloadCmd" "$Le_RealFullChainPath" - if [ "$?" = "9" ] ; then + _output="$(installcert $Le_Domain "$Le_RealCertPath" "$Le_RealKeyPath" "$Le_RealCACertPath" "$Le_ReloadCmd" "$Le_RealFullChainPath" 2>&1)" + _ret="$?" + if [ "$_ret" = "9" ] ; then #ignore the empty install error. return 0 fi + if [ "$_ret" != "0" ] ; then + _err "$_output" + return 1 + fi } renew() { diff --git a/dnsapi/dns_cf.sh b/dnsapi/dns_cf.sh index 2aac3404..2c7f53f9 100755 --- a/dnsapi/dns_cf.sh +++ b/dnsapi/dns_cf.sh @@ -102,7 +102,7 @@ _get_root() { return 1 fi - if printf $response | grep \"name\":\"$h\" ; then + if printf $response | grep \"name\":\"$h\" >/dev/null ; then _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) diff --git a/dnsapi/dns_cx.sh b/dnsapi/dns_cx.sh index dc9c532b..53a277e5 100644 --- a/dnsapi/dns_cx.sh +++ b/dnsapi/dns_cx.sh @@ -144,7 +144,7 @@ _get_root() { return 1; fi - if printf "$response" | grep "$h." ; then + if printf "$response" | grep "$h." >/dev/null ; then seg=$(printf "$response" | grep -o "{[^{]*$h\.[^}]*\}" ) _debug seg "$seg" _domain_id=$(printf "$seg" | grep -o \"id\":\"[^\"]*\" | cut -d : -f 2 | tr -d \") diff --git a/dnsapi/dns_dp.sh b/dnsapi/dns_dp.sh index 510384ab..b267db8b 100644 --- a/dnsapi/dns_dp.sh +++ b/dnsapi/dns_dp.sh @@ -152,7 +152,7 @@ _get_root() { return 1 fi - if printf "$response" | grep "Action completed successful" ; then + if printf "$response" | grep "Action completed successful" >/dev/null ; then _domain_id=$(printf "$response" | grep -o \"id\":\"[^\"]*\" | cut -d : -f 2 | tr -d \") _debug _domain_id "$_domain_id" if [ "$_domain_id" ] ; then