Merge pull request #2240 from pi-hole/tweak/warn_on_tail_if_log_disabled

pihole -t: Warn user if Pi-hole's logging is disabled
This commit is contained in:
Mark Drobnak 2018-06-17 11:23:27 -04:00 committed by GitHub
commit c2055f3514
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

7
pihole
View file

@ -312,6 +312,13 @@ statusFunc() {
} }
tailFunc() { tailFunc() {
# Warn user if Pi-hole's logging is disabled
local logging_enabled=$(grep -c "^log-queries" /etc/dnsmasq.d/01-pihole.conf)
if [[ "${logging_enabled}" == "0" ]]; then
# No "log-queries" lines are found.
# Commented out lines (such as "#log-queries") are ignored
echo " ${CROSS} Warning: Query logging is disabled"
fi
echo -e " ${INFO} Press Ctrl-C to exit" echo -e " ${INFO} Press Ctrl-C to exit"
# Retrieve IPv4/6 addresses # Retrieve IPv4/6 addresses