From d7dde06552785bca11702290706fea147121c1ec Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 18 Jan 2018 17:08:46 +0100 Subject: [PATCH] Add "pihole logging off noflush" command Signed-off-by: DL6ER --- pihole | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pihole b/pihole index e4d6215c..4421cb87 100755 --- a/pihole +++ b/pihole @@ -444,13 +444,17 @@ Specify whether the Pi-hole log should be used Options: on Enable the Pi-hole log at /var/log/pihole.log - off Disable the Pi-hole log at /var/log/pihole.log" + off Disable and flush the Pi-hole log at /var/log/pihole.log + off noflush Disable the Pi-hole log at /var/log/pihole.log" exit 0 elif [[ "${1}" == "off" ]]; then # Disable logging sed -i 's/^log-queries/#log-queries/' /etc/dnsmasq.d/01-pihole.conf sed -i 's/^QUERY_LOGGING=true/QUERY_LOGGING=false/' /etc/pihole/setupVars.conf - pihole -f + if [[ "${2}" != "noflush" ]]; then + # Flush logs + pihole -f + fi echo -e " ${INFO} Disabling logging..." local str="Logging has been disabled!" elif [[ "${1}" == "on" ]]; then