diff --git a/bash_functions.sh b/bash_functions.sh index 886ff65..cb66c62 100644 --- a/bash_functions.sh +++ b/bash_functions.sh @@ -230,17 +230,14 @@ setup_web_password() { setup_var_exists "WEBPASSWORD" && return PASS="$1" - # Turn bash debug on while setting up password (to print it) + # Explicitly turn off bash printing when working with secrets + { set +x; } 2>/dev/null + if [[ "$PASS" == "" ]] ; then echo "" | pihole -a -p else - echo "Setting password: ${PASS}" - set -x pihole -a -p "$PASS" "$PASS" fi - # Turn bash debug back off after print password setup - # (subshell to null hides printing output) - { set +x; } 2>/dev/null # To avoid printing this if conditional in bash debug, turn off debug above.. # then re-enable debug if necessary (more code but cleaner printed output)