From ff47ab12fbc8bc9164c4c75d92f4cfba94d202d2 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 30 Mar 2018 21:01:51 +0200 Subject: [PATCH] Save number of effectively blocked domains in /etc/pihole/numBlocked Signed-off-by: DL6ER --- gravity.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gravity.sh b/gravity.sh index 88ba8bb0..5806dea7 100755 --- a/gravity.sh +++ b/gravity.sh @@ -510,9 +510,11 @@ gravity_ParseBlacklistDomains() { if [[ -f "${piholeDir}/${whitelistMatter}" ]]; then gravity_ParseDomainsIntoHosts "${piholeDir}/${whitelistMatter}" "${piholeDir}/${accretionDisc}" + grep -c "^" "${piholeDir}/${whitelistMatter}" > "${piholeDir}/numBlocked" 2> /dev/null else # There was no whitelist file, so use preEventHorizon instead of whitelistMatter. gravity_ParseDomainsIntoHosts "${piholeDir}/${preEventHorizon}" "${piholeDir}/${accretionDisc}" + grep -c "^" "${piholeDir}/${preEventHorizon}" > "${piholeDir}/numBlocked" 2> /dev/null fi # Move the file over as /etc/pihole/gravity.list so dnsmasq can use it