Merge pull request #1146 from pi-hole/tweak/chronometer_recentlyblocked

[FTL] Show most recently blocked domain in chronometer
This commit is contained in:
DL6ER 2017-03-03 12:20:43 +01:00 committed by GitHub
commit f1b8abf503

View file

@ -49,6 +49,9 @@ normalChrono() {
#uptime -p #Doesn't work on all versions of uptime
uptime | awk -F'( |,|:)+' '{if ($7=="min") m=$6; else {if ($7~/^day/) {d=$6;h=$8;m=$9} else {h=$6;m=$7}}} {print d+0,"days,",h+0,"hours,",m+0,"minutes."}'
echo "-------------------------------"
domain=$(curl -s -X GET http://127.0.0.1/admin/api.php?recentBlocked)
echo "Recently blocked:"
echo " $domain"
# Uncomment to continually read the log file and display the current domain being blocked
#tail -f /var/log/pihole.log | awk '/\/etc\/pihole\/gravity.list/ {if ($7 != "address" && $7 != "name" && $7 != "/etc/pihole/gravity.list") print $7; else;}'