diff --git a/advanced/Scripts/chronometer.sh b/advanced/Scripts/chronometer.sh index 16ff6fb6..2e6cabda 100755 --- a/advanced/Scripts/chronometer.sh +++ b/advanced/Scripts/chronometer.sh @@ -21,12 +21,11 @@ today=$(date "+%b %e") CalcBlockedDomains() { if [ -e "${gravity}" ]; then - #Are we IPV6 or IPV4? - if [[ -n "${IPV6_ADDRESS}" ]]; then - #We are IPV6 + # if BOTH IPV4 and IPV6 are in use, then we need to divide total domains by 2. + if [[ -n "${IPV4_ADDRESS}" && -n "${IPV6_ADDRESS}" ]]; then blockedDomainsTotal=$(wc -l /etc/pihole/gravity.list | awk '{print $1/2}') else - #We are IPV4 + # only one is set. blockedDomainsTotal=$(wc -l /etc/pihole/gravity.list | awk '{print $1}') fi else @@ -104,8 +103,6 @@ normalChrono() { CalcBlockedDomains echo "Blocking: ${blockedDomainsTotal}" - #below commented line does not add up to todaysQueryCount - #echo "Queries: $todaysQueryCountV4 / $todaysQueryCountV6" echo "Queries: ${queriesToday}" #same total calculation as dashboard echo "Pi-holed: ${blockedToday} (${percentBlockedToday}%)"