From 73b8b1201601ec6a9e7f9866c7249d22f5793d76 Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 31 Mar 2016 21:28:54 +0800 Subject: [PATCH] use domain api in sub shell. --- le.sh | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/le.sh b/le.sh index 15b223e5..223c27ed 100755 --- a/le.sh +++ b/le.sh @@ -1040,20 +1040,26 @@ issue() { _err "so the resulting subdomain will be: $txtdomain" continue fi - - if ! source $d_api ; then - _err "Load file $d_api error. Please check your api file and try again." - return 1 - fi - addcommand="$Le_Webroot-add" - if ! command -v $addcommand ; then - _err "It seems that your api file is not correct, it must have a function named: $addcommand" - return 1 - fi + ( + if ! source $d_api ; then + _err "Load file $d_api error. Please check your api file and try again." + return 1 + fi + + addcommand="$Le_Webroot-add" + if ! command -v $addcommand ; then + _err "It seems that your api file is not correct, it must have a function named: $addcommand" + return 1 + fi + + if ! $addcommand $txtdomain $txt ; then + _err "Error add txt for domain:$txtdomain" + return 1 + fi + ) - if ! $addcommand $txtdomain $txt ; then - _err "Error add txt for domain:$txtdomain" + if [[ "$?" != "0" ]] ; then return 1 fi dnsadded='1'