mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 14:20:18 +00:00
No need to >/dev/null because setFTLConfigValue already does this
adjust output of setFTLConfigValue to test for the exit code of `pihole-FTL --config`
This commit is contained in:
parent
6292e65b37
commit
ab3b6dfa67
2 changed files with 6 additions and 2 deletions
|
@ -145,4 +145,8 @@ getFTLConfigValue(){
|
||||||
#######################
|
#######################
|
||||||
setFTLConfigValue(){
|
setFTLConfigValue(){
|
||||||
pihole-FTL --config "${1}" "${2}" >/dev/null
|
pihole-FTL --config "${1}" "${2}" >/dev/null
|
||||||
|
if [[ $? -eq 5 ]]; then
|
||||||
|
echo -e " ${CROSS} ${1} set by environment variable. Please unset it to use this function"
|
||||||
|
exit 5
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
4
pihole
4
pihole
|
@ -43,7 +43,7 @@ SetWebPassword() {
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
if [ "${PASSWORD}" == "" ]; then
|
if [ "${PASSWORD}" == "" ]; then
|
||||||
setFTLConfigValue "webserver.api.password" "" >/dev/null
|
setFTLConfigValue "webserver.api.password" ""
|
||||||
echo -e " ${TICK} Password Removed"
|
echo -e " ${TICK} Password Removed"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -54,7 +54,7 @@ SetWebPassword() {
|
||||||
|
|
||||||
if [ "${PASSWORD}" == "${CONFIRM}" ] ; then
|
if [ "${PASSWORD}" == "${CONFIRM}" ] ; then
|
||||||
# pihole-FTL will automatically hash the password
|
# pihole-FTL will automatically hash the password
|
||||||
setFTLConfigValue "webserver.api.password" "${PASSWORD}" >/dev/null
|
setFTLConfigValue "webserver.api.password" "${PASSWORD}"
|
||||||
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"
|
||||||
|
|
Loading…
Reference in a new issue