mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-01-12 06:54:53 +00:00
Merge pull request #1013 from pi-hole/fix/chronometer
Fix chronometer.sh
This commit is contained in:
commit
ef1ce66793
1 changed files with 3 additions and 5 deletions
|
@ -15,8 +15,6 @@
|
||||||
piLog="/var/log/pihole.log"
|
piLog="/var/log/pihole.log"
|
||||||
gravity="/etc/pihole/gravity.list"
|
gravity="/etc/pihole/gravity.list"
|
||||||
|
|
||||||
today=$(date "+%b %e")
|
|
||||||
|
|
||||||
. /etc/pihole/setupVars.conf
|
. /etc/pihole/setupVars.conf
|
||||||
|
|
||||||
CalcBlockedDomains() {
|
CalcBlockedDomains() {
|
||||||
|
@ -35,7 +33,7 @@ CalcBlockedDomains() {
|
||||||
|
|
||||||
CalcQueriesToday() {
|
CalcQueriesToday() {
|
||||||
if [ -e "${piLog}" ]; then
|
if [ -e "${piLog}" ]; then
|
||||||
queriesToday=$(cat "${piLog}" | grep "${today}" | awk '/query/ {print $6}' | wc -l)
|
queriesToday=$(awk '/query\[/ {print $6}' < "${piLog}" | wc -l)
|
||||||
else
|
else
|
||||||
queriesToday="Err."
|
queriesToday="Err."
|
||||||
fi
|
fi
|
||||||
|
@ -43,7 +41,7 @@ CalcQueriesToday() {
|
||||||
|
|
||||||
CalcblockedToday() {
|
CalcblockedToday() {
|
||||||
if [ -e "${piLog}" ] && [ -e "${gravity}" ];then
|
if [ -e "${piLog}" ] && [ -e "${gravity}" ];then
|
||||||
blockedToday=$(cat ${piLog} | awk '/\/etc\/pihole\/gravity.list/ && !/address/ {print $6}' | wc -l)
|
blockedToday=$(awk '/\/etc\/pihole\/gravity.list/ && !/address/ {print $6}' < "${piLog}" | wc -l)
|
||||||
else
|
else
|
||||||
blockedToday="Err."
|
blockedToday="Err."
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue