I tried to do too many things in one function, vastly overcomplicating what should have been _this_ all along

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner
2022-04-14 22:53:38 +01:00
parent 9356d7bbb1
commit db116971ce
3 changed files with 28 additions and 22 deletions

4
pihole
View File

@@ -260,7 +260,7 @@ Options:
exit 0
elif [[ "${1}" == "off" ]]; then
# Disable logging
addOrEditKeyValPair /etc/dnsmasq.d/01-pihole.conf "log-queries"
removeKey /etc/dnsmasq.d/01-pihole.conf "log-queries"
addOrEditKeyValPair "${setupVars}" "QUERY_LOGGING" "false"
if [[ "${2}" != "noflush" ]]; then
# Flush logs
@@ -270,7 +270,7 @@ Options:
local str="Logging has been disabled!"
elif [[ "${1}" == "on" ]]; then
# Enable logging
removeKey /etc/dnsmasq.d/01-pihole.conf "log-queries"
addKey /etc/dnsmasq.d/01-pihole.conf "log-queries"
addOrEditKeyValPair "${setupVars}" "QUERY_LOGGING" "true"
echo -e " ${INFO} Enabling logging..."
local str="Logging has been enabled!"