Change password logic completely to avoid any extra debug prints
Signed-off-by: Adam Hill <adam@diginc.us>
This commit is contained in:
parent
f1b34887f8
commit
c290324185
|
@ -49,7 +49,7 @@ docker run -d \
|
||||||
pihole/pihole:latest
|
pihole/pihole:latest
|
||||||
|
|
||||||
echo -n "Your password for https://${IP}/admin/ is "
|
echo -n "Your password for https://${IP}/admin/ is "
|
||||||
docker logs pihole 2> /dev/null | grep 'password:'
|
docker logs pihole 2> /dev/null | grep 'password'
|
||||||
```
|
```
|
||||||
|
|
||||||
**This is just an example and might need changing.** Volumes are stored in the directory `$DOCKER_CONFIGS` and are recommended for persisting data across docker re-creations for updating images. As mentioned on line 2, the auto `IP_LOOKUP` variable may not work for VPN tunnel interfaces.
|
**This is just an example and might need changing.** Volumes are stored in the directory `$DOCKER_CONFIGS` and are recommended for persisting data across docker re-creations for updating images. As mentioned on line 2, the auto `IP_LOOKUP` variable may not work for VPN tunnel interfaces.
|
||||||
|
|
|
@ -242,16 +242,21 @@ generate_password() {
|
||||||
setup_web_password() {
|
setup_web_password() {
|
||||||
PASS="$1"
|
PASS="$1"
|
||||||
# Turn bash debug on while setting up password (to print it)
|
# Turn bash debug on while setting up password (to print it)
|
||||||
set -x
|
|
||||||
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
|
||||||
if [ "${PH_VERBOSE:-0}" -lt 1 ] ; then
|
# Turn bash debug back off after print password setup
|
||||||
# Turn bash debug back off after print password setup
|
# (subshell to null hides printing output)
|
||||||
# (subshell to null hides printing output)
|
{ set +x; } 2>/dev/null
|
||||||
{ 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)
|
||||||
|
if [ "${PH_VERBOSE:-0}" -gt 0 ] ; then
|
||||||
|
set -x
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue