mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Also display how many unique domains we have caught in the event horizon.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
037d52104a
commit
0c5185f8ba
1 changed files with 13 additions and 8 deletions
21
gravity.sh
21
gravity.sh
|
@ -529,19 +529,24 @@ gravity_ParseFileIntoDomains() {
|
||||||
gravity_Table_Count() {
|
gravity_Table_Count() {
|
||||||
local table="${1}"
|
local table="${1}"
|
||||||
local str="${2}"
|
local str="${2}"
|
||||||
local extra="${3}"
|
|
||||||
local num
|
local num
|
||||||
num="$(sqlite3 "${gravityDBfile}" "SELECT COUNT(*) FROM ${table} ${extra};")"
|
num="$(sqlite3 "${gravityDBfile}" "SELECT COUNT(*) FROM ${table};")"
|
||||||
echo -e " ${INFO} Number of ${str}: ${num}"
|
if [[ "${table}" == "vw_gravity" ]]; then
|
||||||
|
local unique
|
||||||
|
unique="$(sqlite3 "${gravityDBfile}" "SELECT COUNT(DISTINCT domain) FROM ${table};")"
|
||||||
|
echo -e " ${INFO} Number of ${str}: ${num} (${unique} unique domains)"
|
||||||
|
else
|
||||||
|
echo -e " ${INFO} Number of ${str}: ${num}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Output count of blacklisted domains and regex filters
|
# Output count of blacklisted domains and regex filters
|
||||||
gravity_ShowCount() {
|
gravity_ShowCount() {
|
||||||
gravity_Table_Count "gravity" "gravity domains" ""
|
gravity_Table_Count "vw_gravity" "gravity domains" ""
|
||||||
gravity_Table_Count "blacklist" "exact blacklisted domains" "WHERE enabled = 1"
|
gravity_Table_Count "vw_blacklist" "exact blacklisted domains"
|
||||||
gravity_Table_Count "regex_blacklist" "regex blacklist filters" "WHERE enabled = 1"
|
gravity_Table_Count "vw_regex_blacklist" "regex blacklist filters"
|
||||||
gravity_Table_Count "whitelist" "exact whitelisted domains" "WHERE enabled = 1"
|
gravity_Table_Count "vw_whitelist" "exact whitelisted domains"
|
||||||
gravity_Table_Count "regex_whitelist" "regex whitelist filters" "WHERE enabled = 1"
|
gravity_Table_Count "vw_regex_whitelist" "regex whitelist filters"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Parse list of domains into hosts format
|
# Parse list of domains into hosts format
|
||||||
|
|
Loading…
Reference in a new issue