1
0
mirror of https://github.com/pi-hole/pi-hole synced 2025-01-10 16:10:56 +00:00

Fix setting webpassword via pihole -a -p

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König 2023-02-03 19:55:55 +01:00 committed by Adam Warner
parent 3695610300
commit 3cb3adc5ca
No known key found for this signature in database

View File

@ -165,7 +165,7 @@ SetWebPassword() {
echo "" echo ""
if [ "${PASSWORD}" == "" ]; then if [ "${PASSWORD}" == "" ]; then
setFTLConfigValue "api.pwhash" "" setFTLConfigValue "webserver.api.pwhash" "" >/dev/null
echo -e " ${TICK} Password Removed" echo -e " ${TICK} Password Removed"
exit 0 exit 0
fi fi
@ -178,7 +178,7 @@ SetWebPassword() {
# We do not wrap this in brackets, otherwise BASH will expand any appropriate syntax # We do not wrap this in brackets, otherwise BASH will expand any appropriate syntax
hash=$(HashPassword "$PASSWORD") hash=$(HashPassword "$PASSWORD")
# Save hash to file # Save hash to file
setFTLConfigValue "api.pwhash" "${hash}" setFTLConfigValue "webserver.api.pwhash" "${hash}" >/dev/null
echo -e " ${TICK} New password set" echo -e " ${TICK} New password set"
else else
echo -e " ${CROSS} Passwords don't match. Your password has not been changed" echo -e " ${CROSS} Passwords don't match. Your password has not been changed"