1
0
mirror of https://github.com/pi-hole/pi-hole synced 2025-01-08 15:10:55 +00:00

Merge pull request #1707 from pi-hole/fix/tailFunc

Correctly retrieve IPv4/6 addresses for tailFunc()
This commit is contained in:
WaLLy3K 2017-09-24 10:28:36 +10:00 committed by GitHub
commit 05faa7bdf2

19
pihole
View File

@ -508,13 +508,20 @@ statusFunc() {
} }
tailFunc() { tailFunc() {
date=$(date +'%b %d ')
echo -e " ${INFO} Press Ctrl-C to exit" echo -e " ${INFO} Press Ctrl-C to exit"
tail -f /var/log/pihole.log | sed \
-e "s,\(${date}\| dnsmasq\[.*[0-9]]\),,g" \ # Retrieve IPv4/6 addresses
-e "s,\(.*\(gravity.list\|black.list\| config \).* is \(${IPV4_ADDRESS%/*}\|${IPV6_ADDRESS:-NULL}\).*\),${COL_LIGHT_RED}&${COL_NC}," \ source /etc/pihole/setupVars.conf
-e "s,.*\(query\[A\|DHCP\).*,${COL_NC}&${COL_NC}," \
-e "s,.*,${COL_DARK_GRAY}&${COL_NC}," # Strip date from each line
# Colour blocklist/blacklist/wildcard entries as red
# Colour A/AAAA/DHCP strings as white
# Colour everything else as gray
tail -f /var/log/pihole.log | sed -E \
-e "s,($(date +'%b %d ')| dnsmasq[.*[0-9]]),,g" \
-e "s,(.*(gravity.list|black.list| config ).* is (${IPV4_ADDRESS%/*}|${IPV6_ADDRESS:-NULL}).*),${COL_RED}&${COL_NC}," \
-e "s,.*(query\\[A|DHCP).*,${COL_NC}&${COL_NC}," \
-e "s,.*,${COL_GRAY}&${COL_NC},"
exit 0 exit 0
} }