Convert SetWebPassword to use new FTL config

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
Adam Warner 1 year ago
parent d95ff956aa
commit f4a9d09e5b
No known key found for this signature in database

@ -75,7 +75,7 @@ deleteFTLsetting() {
}
changeFTLsetting() {
addOrEditKeyValPair "${FTLconf}" "${1}" "${2}"
pihole-FTL --config "${1}" "${2}"
}
add_dnsmasq_setting() {
@ -122,7 +122,7 @@ SetWebPassword() {
echo ""
if [ "${PASSWORD}" == "" ]; then
addOrEditKeyValPair "${setupVars}" "WEBPASSWORD" ""
setFTLConfigValue "api.pwhash" ""
echo -e " ${TICK} Password Removed"
exit 0
fi
@ -135,7 +135,7 @@ SetWebPassword() {
# We do not wrap this in brackets, otherwise BASH will expand any appropriate syntax
hash=$(HashPassword "$PASSWORD")
# Save hash to file
addOrEditKeyValPair "${setupVars}" "WEBPASSWORD" "${hash}"
setFTLConfigValue "api.pwhash" "${hash}"
echo -e " ${TICK} New password set"
else
echo -e " ${CROSS} Passwords don't match. Your password has not been changed"

Loading…
Cancel
Save