mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Merge pull request #1922 from pi-hole/tweak/logging-noflush
Add "pihole logging off noflush" command
This commit is contained in:
commit
8ee3d810b0
1 changed files with 6 additions and 2 deletions
6
pihole
6
pihole
|
@ -444,13 +444,17 @@ Specify whether the Pi-hole log should be used
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
on Enable the Pi-hole log at /var/log/pihole.log
|
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
|
exit 0
|
||||||
elif [[ "${1}" == "off" ]]; then
|
elif [[ "${1}" == "off" ]]; then
|
||||||
# Disable logging
|
# Disable logging
|
||||||
sed -i 's/^log-queries/#log-queries/' /etc/dnsmasq.d/01-pihole.conf
|
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
|
sed -i 's/^QUERY_LOGGING=true/QUERY_LOGGING=false/' /etc/pihole/setupVars.conf
|
||||||
|
if [[ "${2}" != "noflush" ]]; then
|
||||||
|
# Flush logs
|
||||||
pihole -f
|
pihole -f
|
||||||
|
fi
|
||||||
echo -e " ${INFO} Disabling logging..."
|
echo -e " ${INFO} Disabling logging..."
|
||||||
local str="Logging has been disabled!"
|
local str="Logging has been disabled!"
|
||||||
elif [[ "${1}" == "on" ]]; then
|
elif [[ "${1}" == "on" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue