When setting the password, explicitly disable bash logging. Leave the re-enable code so that other functions work as expected. Additionally, do not remove the print in generate_password so randomly generated passwords are still logged for user consistency. Signed-off-by: Kyle Kurz <kyle@doublekaudio.com>
This commit is contained in:
parent
190844d0b0
commit
f53015157d
|
@ -230,17 +230,14 @@ setup_web_password() {
|
||||||
setup_var_exists "WEBPASSWORD" && return
|
setup_var_exists "WEBPASSWORD" && return
|
||||||
|
|
||||||
PASS="$1"
|
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
|
if [[ "$PASS" == "" ]] ; then
|
||||||
echo "" | pihole -a -p
|
echo "" | pihole -a -p
|
||||||
else
|
else
|
||||||
echo "Setting password: ${PASS}"
|
|
||||||
set -x
|
|
||||||
pihole -a -p "$PASS" "$PASS"
|
pihole -a -p "$PASS" "$PASS"
|
||||||
fi
|
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..
|
# 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)
|
# then re-enable debug if necessary (more code but cleaner printed output)
|
||||||
|
|
Loading…
Reference in New Issue