Convert SetWebPassword to use new FTL config

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner 2023-01-14 23:15:40 +00:00
parent 632aead691
commit 019be067d9
No known key found for this signature in database

View file

@ -77,7 +77,7 @@ deleteFTLsetting() {
} }
changeFTLsetting() { changeFTLsetting() {
addOrEditKeyValPair "${FTLconf}" "${1}" "${2}" pihole-FTL --config "${1}" "${2}"
} }
add_dnsmasq_setting() { add_dnsmasq_setting() {
@ -165,7 +165,7 @@ SetWebPassword() {
echo "" echo ""
if [ "${PASSWORD}" == "" ]; then if [ "${PASSWORD}" == "" ]; then
addOrEditKeyValPair "${setupVars}" "WEBPASSWORD" "" setFTLConfigValue "api.pwhash" ""
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
addOrEditKeyValPair "${setupVars}" "WEBPASSWORD" "${hash}" setFTLConfigValue "api.pwhash" "${hash}"
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"