From 209fbf82c403c495867bae77b5ef585c1a76b986 Mon Sep 17 00:00:00 2001 From: WaLLy3K Date: Sun, 2 Jul 2017 23:21:00 +1000 Subject: [PATCH] Colourise tailFunc (#1550) * Colourise tailFunc * Strip month, day number and dnsmasq[PID] * Blocked domains show as light red * Queries show as standard colour * Everything else as dark gray * Change tailFunc highlighted lines * Highlight Blocked/Blacklist/Wildcard lines as red * Make DHCP lines default colour * Make sure tailFunc doesn't match on domain names --- pihole | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pihole b/pihole index 93b35393..3c321b93 100755 --- a/pihole +++ b/pihole @@ -340,8 +340,13 @@ piholeStatus() { } tailFunc() { + date=$(date +'%b %d ') echo -e " ${INFO} Press Ctrl-C to exit" - tail -F /var/log/pihole.log + tail -f /var/log/pihole.log | sed \ + -e "s,\(${date}\| dnsmasq\[.*[0-9]]\),,g" \ + -e "s,\(.*\(gravity.list\|black.list\| config \).* is \(${IPV4_ADDRESS%/*}\|${IPV6_ADDRESS:-NULL}\).*\),${COL_LIGHT_RED}&${COL_NC}," \ + -e "s,.*\(query\[A\|DHCP\).*,${COL_NC}&${COL_NC}," \ + -e "s,.*,${COL_DARK_GRAY}&${COL_NC}," exit 0 }