Modification of Le_Domain is local (to subshell caused by (..) group)
5810 export CERT_KEY_PATH
5811 export CA_CERT_PATH
5812 export CERT_FULLCHAIN_PATH
5813 export Le_Domain="$_main_domain"5814 cd "$DOMAIN_PATH" && eval "$_reload_cmd"
5815 ); then
5816 _info "$(__green "Reload success")"
Modification of DOMAIN_CONF is local (to subshell caused by (..) group)
5608 _isEcc="ecc"
5609 d=$(echo "$d" | cut -d "$ECC_SEP" -f 1)
5610 fi
5611 DOMAIN_CONF="$di/$d.conf"5612 if [ -f "$DOMAIN_CONF" ]; then
5613 . "$DOMAIN_CONF"
5614 _ca="$(_getCAShortName "$Le_API")"
Modification of d is local (to subshell caused by (..) group)
5606 (
5607 if _endswith "$d" "$ECC_SUFFIX"; then
5608 _isEcc="ecc"
5609 d=$(echo "$d" | cut -d "$ECC_SEP" -f 1)5610 fi
5611 DOMAIN_CONF="$di/$d.conf"
5612 if [ -f "$DOMAIN_CONF" ]; then
Modification of d is local (to subshell caused by (..) group)
5394 (
5395 if _endswith "$d" "$ECC_SUFFIX"; then
5396 _isEcc=$(echo "$d" | cut -d "$ECC_SEP" -f 2)
5397 d=$(echo "$d" | cut -d "$ECC_SEP" -f 1)5398 fi
5399 renew "$d" "$_isEcc" "$_server"
5400 )
Modification of Le_Domain is local (to subshell caused by (..) group)
3557 export CERT_KEY_PATH
3558 export CA_CERT_PATH
3559 export CERT_FULLCHAIN_PATH
3560 export Le_Domain="$_main_domain"3561 cd "$DOMAIN_PATH" && eval "$_chk_post_hook"
3562 ); then
3563 _err "Error when run post hook."
Modification of Le_Alt is local (to subshell caused by (..) group)
3410 _info "Run pre hook:'$_chk_pre_hook'"
3411 if ! (
3412 export Le_Domain="$_chk_main_domain"
3413 export Le_Alt="$_chk_alt_domains"3414 cd "$DOMAIN_PATH" && eval "$_chk_pre_hook"
3415 ); then
3416 _err "Error when run pre hook."
Modification of Le_Domain is local (to subshell caused by (..) group)
3409 if [ "$_chk_pre_hook" ]; then
3410 _info "Run pre hook:'$_chk_pre_hook'"
3411 if ! (
3412 export Le_Domain="$_chk_main_domain"3413 export Le_Alt="$_chk_alt_domains"
3414 cd "$DOMAIN_PATH" && eval "$_chk_pre_hook"
3415 ); then
Description
Variables set in subshells are not available outside the subshell. This is a wide topic, and better described in the Wooledge Bash Wiki.
Problematic code:
There are many ways of accidentally creating subshells, but a common one is piping to a loop:
n=0
printf "%s\n" {1..10} | while read i; do (( n+=i )); done
echo $n
Preferred code:
# Bash specific: process substitution. You may also try `shopt` with lastpipe.
n=0
while read i; do (( n+=i )); done < <(printf "%s\n" {1..10})
echo $n
In sh
, a temp file can be used instead of process substitution. If it's acceptable to do it with waiting, try Here Documents
.
Exception:
You can ignore this error if this is intended and you don't care that the changes aren't reflected.