diff --git a/commands/eval-capture b/commands/eval-capture index d21aaf43e..fa3fbb367 100755 --- a/commands/eval-capture +++ b/commands/eval-capture @@ -27,7 +27,7 @@ if [[ $* == '--test' ]]; then )" eval-tester --name='as expected' --status='1' --stdout="$expected" \ -- eval-capture -- - exit $? + exit elif [[ $* == '--' ]]; then : # all good, run else diff --git a/commands/is-dns-working b/commands/is-dns-working index 508f9dd8b..f05a1dfcb 100755 --- a/commands/is-dns-working +++ b/commands/is-dns-working @@ -75,7 +75,7 @@ function is_dns_working() ( echo-style --error1='DNS is not working.' )" \ -- "${cmd[@]}" - return $? + return ) # fire if invoked standalone diff --git a/commands/is-internet-working b/commands/is-internet-working index 31b8403a8..7cf39d83f 100755 --- a/commands/is-internet-working +++ b/commands/is-internet-working @@ -77,7 +77,7 @@ function is_internet_working() ( echo-style --error1='Internet is not working. If it is a DNS issue, then ' --code-error1='setup-dns' --error1=' may help.' )" \ -- "${cmd[@]}" - return $? + return ) # fire if invoked standalone diff --git a/commands/setup-dns b/commands/setup-dns index 5fe8361aa..c45e2d1cc 100755 --- a/commands/setup-dns +++ b/commands/setup-dns @@ -679,7 +679,7 @@ function setup_dns() ( # check if ! __adguard_home__available; then die_incompatible_dns_service "$adguard_home__title" - return $? + return fi # log @@ -826,7 +826,7 @@ function setup_dns() ( # check if ! __cloudflared__available; then die_incompatible_dns_service "$cloudflared__title" - return $? + return fi # log @@ -1069,7 +1069,7 @@ EOF # check if ! __dnscrypt_proxy__available; then die_incompatible_dns_service "$dnscrypt_proxy__title" - return $? + return fi # prepare and log diff --git a/commands/setup-environment-commands b/commands/setup-environment-commands index ce56df07d..d93fd202c 100755 --- a/commands/setup-environment-commands +++ b/commands/setup-environment-commands @@ -48,7 +48,7 @@ export shell="${1-}" # testing if [[ $* == *'--refresh'* ]]; then env -i DOROTHY="$DOROTHY" "$DOROTHY/commands/setup-environment-commands" "$shell" - exit $? + exit fi # environment provides: diff --git a/commands/setup-util-adguard-home b/commands/setup-util-adguard-home index 48f94feb9..d10b89c53 100755 --- a/commands/setup-util-adguard-home +++ b/commands/setup-util-adguard-home @@ -31,7 +31,7 @@ function setup_util_adguard_home() ( source "$DOROTHY/sources/bash.bash" setup-dns --service='adguard-home' "$@" - return $? + return ) # fire if invoked standalone diff --git a/commands/setup-util-cloudflared b/commands/setup-util-cloudflared index ecd176f34..d21b55c97 100755 --- a/commands/setup-util-cloudflared +++ b/commands/setup-util-cloudflared @@ -32,7 +32,7 @@ function setup_util_cloudflared() ( source "$DOROTHY/sources/bash.bash" setup-dns --service='cloudflared' "$@" - return $? + return ) # fire if invoked standalone diff --git a/commands/setup-util-dnscrypt-proxy b/commands/setup-util-dnscrypt-proxy index 0b5591846..9069c3ec7 100755 --- a/commands/setup-util-dnscrypt-proxy +++ b/commands/setup-util-dnscrypt-proxy @@ -32,7 +32,7 @@ function setup_util_dnscrypt_proxy() ( source "$DOROTHY/sources/bash.bash" setup-dns --service='dnscrypt-proxy' "$@" - return $? + return ) # fire if invoked standalone diff --git a/sources/bash.bash b/sources/bash.bash index f19075621..17d06da0e 100644 --- a/sources/bash.bash +++ b/sources/bash.bash @@ -567,7 +567,7 @@ function eval_capture { # __print_lines "PRE: [$EVAL_CAPTURE_STATUS] cmd=[$EVAL_CAPTURE_COMMAND] subshell=[$EVAL_CAPTURE_SUBSHELL] context=[$EVAL_CAPTURE_CONTEXT]" >/dev/tty EVAL_CAPTURE_COUNT="$((EVAL_CAPTURE_COUNT + 1))" # wrap if the $- check, as always returning causes +e to return when it shouldn't - trap 'EVAL_CAPTURE_RETURN=$?; if [[ $- = *e* ]]; then eval_capture_wrapper_trap "$EVAL_CAPTURE_RETURN" "${FUNCNAME-}" "${cmd[*]}" "${BASH_SUBSHELL-}" "$EVAL_CAPTURE_CONTEXT"; return $?; fi' ERR + trap 'EVAL_CAPTURE_RETURN=$?; if [[ $- = *e* ]]; then eval_capture_wrapper_trap "$EVAL_CAPTURE_RETURN" "${FUNCNAME-}" "${cmd[*]}" "${BASH_SUBSHELL-}" "$EVAL_CAPTURE_CONTEXT"; return; fi' ERR # can't delegate this to a function (e.g. is_subshell_function), as the trap will go to the function if [[ $IS_BASH_VERSION_OUTDATED == 'yes' && $- == *e* && "$(declare -f "${cmd[0]}")" == "${cmd[0]}"$' () \n{ \n ('* ]]; then # ALL SUBSHELLS SHOULD RE-ENABLE [set -e]