From 4fb5157719f3f8c74e9dfb9e8167673c96947532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Fri, 4 Jun 2021 21:59:17 +0200 Subject: [PATCH] Squashed commits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add simple grep function to pihole -t Signed-off-by: Christian König Add help info Signed-off-by: Christian König Improve help info Signed-off-by: Christian König Fix details Signed-off-by: Christian König --- pihole | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pihole b/pihole index f8085c8e..58ec385a 100755 --- a/pihole +++ b/pihole @@ -370,7 +370,7 @@ tailFunc() { # Color blocklist/blacklist/wildcard entries as red # Color A/AAAA/DHCP strings as white # Color everything else as gray - tail -f /var/log/pihole.log | sed -E \ + tail -f /var/log/pihole.log | grep --line-buffered "${1}" | sed -E \ -e "s,($(date +'%b %d ')| dnsmasq\[[0-9]*\]),,g" \ -e "s,(.*(blacklisted |gravity blocked ).* is (0.0.0.0|::|NXDOMAIN|${IPV4_ADDRESS%/*}|${IPV6_ADDRESS:-NULL}).*),${COL_RED}&${COL_NC}," \ -e "s,.*(query\\[A|DHCP).*,${COL_NC}&${COL_NC}," \ @@ -456,7 +456,10 @@ Debugging Options: Add '-a' to automatically upload the log to tricorder.pi-hole.net -f, flush Flush the Pi-hole log -r, reconfigure Reconfigure or Repair Pi-hole subsystems - -t, tail View the live output of the Pi-hole log + -t, tail [arg] View the live output of the Pi-hole log. + Add an optional argument to filter the log + (regular expressions are supported) + Options: -a, admin Web interface options @@ -530,7 +533,7 @@ case "${1}" in "status" ) statusFunc "$2";; "restartdns" ) restartDNS "$2";; "-a" | "admin" ) webpageFunc "$@";; - "-t" | "tail" ) tailFunc;; + "-t" | "tail" ) tailFunc "$2";; "checkout" ) piholeCheckoutFunc "$@";; "tricorder" ) tricorderFunc;; "updatechecker" ) updateCheckFunc "$@";;