mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-22 22:10:56 +00:00
Fix logic. If both v6 and v4 divide by two, else dont.
This commit is contained in:
parent
d7d6d6f991
commit
4300759287
@ -21,12 +21,11 @@ today=$(date "+%b %e")
|
|||||||
|
|
||||||
CalcBlockedDomains() {
|
CalcBlockedDomains() {
|
||||||
if [ -e "${gravity}" ]; then
|
if [ -e "${gravity}" ]; then
|
||||||
#Are we IPV6 or IPV4?
|
# if BOTH IPV4 and IPV6 are in use, then we need to divide total domains by 2.
|
||||||
if [[ -n "${IPV6_ADDRESS}" ]]; then
|
if [[ -n "${IPV4_ADDRESS}" && -n "${IPV6_ADDRESS}" ]]; then
|
||||||
#We are IPV6
|
|
||||||
blockedDomainsTotal=$(wc -l /etc/pihole/gravity.list | awk '{print $1/2}')
|
blockedDomainsTotal=$(wc -l /etc/pihole/gravity.list | awk '{print $1/2}')
|
||||||
else
|
else
|
||||||
#We are IPV4
|
# only one is set.
|
||||||
blockedDomainsTotal=$(wc -l /etc/pihole/gravity.list | awk '{print $1}')
|
blockedDomainsTotal=$(wc -l /etc/pihole/gravity.list | awk '{print $1}')
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@ -104,8 +103,6 @@ normalChrono() {
|
|||||||
CalcBlockedDomains
|
CalcBlockedDomains
|
||||||
|
|
||||||
echo "Blocking: ${blockedDomainsTotal}"
|
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 "Queries: ${queriesToday}" #same total calculation as dashboard
|
||||||
echo "Pi-holed: ${blockedToday} (${percentBlockedToday}%)"
|
echo "Pi-holed: ${blockedToday} (${percentBlockedToday}%)"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user