From 60142cd960cecd6abac329243aa9e6c85b86521d Mon Sep 17 00:00:00 2001 From: Promofaux Date: Thu, 27 Oct 2016 11:06:11 +0100 Subject: [PATCH 1/3] remove reference to whitelist.sh (no longer exists) replace with `pihole -w` --- gravity.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gravity.sh b/gravity.sh index f524e587..1e4a3a93 100755 --- a/gravity.sh +++ b/gravity.sh @@ -29,8 +29,7 @@ EOM adListFile=/etc/pihole/adlists.list adListDefault=/etc/pihole/adlists.default -whitelistScript=/opt/pihole/whitelist.sh -blacklistScript=/opt/pihole/blacklist.sh +whitelistScript="pihole -w" whitelistFile=/etc/pihole/whitelist.txt blacklistFile=/etc/pihole/blacklist.txt From 9e4e1d1cb2d7b8a1293e510289a6c91581cf2985 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Thu, 27 Oct 2016 11:09:24 +0100 Subject: [PATCH 2/3] improve comments --- gravity.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gravity.sh b/gravity.sh index 1e4a3a93..8373b4aa 100755 --- a/gravity.sh +++ b/gravity.sh @@ -185,7 +185,7 @@ gravity_Schwarzchild() { } gravity_Blacklist() { - # Append blacklist entries if they exist + # Append blacklist entries to eventHorizon if they exist if [[ -f "${blacklistFile}" ]]; then numBlacklisted=$(wc -l < "${blacklistFile}") plural=; [[ "$numBlacklisted" != "1" ]] && plural=s @@ -215,11 +215,13 @@ gravity_Whitelist() { # Ensure adlist domains are in whitelist.txt ${whitelistScript} -nr -q "${urls[@]}" > /dev/null + # Check whitelist.txt exists. if [[ -f "${whitelistFile}" ]]; then # Remove anything in whitelist.txt from the Event Horizon numWhitelisted=$(wc -l < "${whitelistFile}") plural=; [[ "$numWhitelisted" != "1" ]] && plural=s echo -n "::: Whitelisting $numWhitelisted domain${plural}..." + #print everything from preEventHorizon into eventHorizon EXCEPT domains in whitelist.txt grep -F -x -v -f ${whitelistFile} ${piholeDir}/${preEventHorizon} > ${piholeDir}/${eventHorizon} echo " done!" else From 794fa211372a4b6daa5e311d4454277abe229d57 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Thu, 27 Oct 2016 12:44:21 +0100 Subject: [PATCH 3/3] install uninstall.sh... --- automated install/basic-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 620ac17f..89191fed 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -565,6 +565,7 @@ installScripts() { install -o "${USER}" -Dm755 -t /opt/pihole/ gravity.sh install -o "${USER}" -Dm755 -t /opt/pihole/ ./advanced/Scripts/*.sh + install -o "${USER}" -Dm755 -t /opt/pihole/ ./automated\ install/uninstall.sh install -o "${USER}" -Dm755 -t /usr/local/bin/ pihole install -Dm644 ./advanced/bash-completion/pihole /etc/bash_completion.d/pihole