Merge pull request #867 from pi-hole/gravTweaks

No need to reference script that does not exist...
This commit is contained in:
Adam Warner 2016-10-27 18:09:28 +01:00 committed by GitHub
commit a38edd891f
2 changed files with 5 additions and 3 deletions

View file

@ -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

View file

@ -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
@ -186,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
@ -216,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