mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Show number of wildcard blocked domains in gravity's summary
This commit is contained in:
parent
0375a3caa3
commit
a8ac212ee6
1 changed files with 17 additions and 0 deletions
17
gravity.sh
17
gravity.sh
|
@ -32,6 +32,7 @@ adListDefault=/etc/pihole/adlists.default
|
||||||
whitelistScript="pihole -w"
|
whitelistScript="pihole -w"
|
||||||
whitelistFile=/etc/pihole/whitelist.txt
|
whitelistFile=/etc/pihole/whitelist.txt
|
||||||
blacklistFile=/etc/pihole/blacklist.txt
|
blacklistFile=/etc/pihole/blacklist.txt
|
||||||
|
readonly wildcardlist="/etc/dnsmasq.d/03-pihole-wildcard.conf"
|
||||||
|
|
||||||
#Source the setupVars from install script for the IP
|
#Source the setupVars from install script for the IP
|
||||||
setupVars=/etc/pihole/setupVars.conf
|
setupVars=/etc/pihole/setupVars.conf
|
||||||
|
@ -235,6 +236,21 @@ gravity_Blacklist() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gravity_Wildcard() {
|
||||||
|
# Return number of wildcards in output - don't actually handle wildcards
|
||||||
|
if [[ -f "${wildcardlist}" ]]; then
|
||||||
|
num=$(grep -c ^ "${wildcardlist}")
|
||||||
|
if [[ -n "${IPV4_ADDRESS}" && -n "${IPV6_ADDRESS}" ]];then
|
||||||
|
let num/=2
|
||||||
|
fi
|
||||||
|
plural=; [[ "$num" != "1" ]] && plural=s
|
||||||
|
echo "::: Wildcard blocked domain${plural}: $numBlacklisted"
|
||||||
|
else
|
||||||
|
echo "::: No wildcards used!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
gravity_Whitelist() {
|
gravity_Whitelist() {
|
||||||
#${piholeDir}/${eventHorizon})
|
#${piholeDir}/${eventHorizon})
|
||||||
echo ":::"
|
echo ":::"
|
||||||
|
@ -401,6 +417,7 @@ else
|
||||||
fi
|
fi
|
||||||
gravity_Whitelist
|
gravity_Whitelist
|
||||||
gravity_Blacklist
|
gravity_Blacklist
|
||||||
|
gravity_Wildcard
|
||||||
|
|
||||||
gravity_hostFormat
|
gravity_hostFormat
|
||||||
gravity_blackbody
|
gravity_blackbody
|
||||||
|
|
Loading…
Reference in a new issue