From 185969b137119f8c01e54bc91bc3eacbb5b46db9 Mon Sep 17 00:00:00 2001 From: Mospaeda Date: Thu, 19 Mar 2015 23:09:36 +0100 Subject: [PATCH] Update gravity-adv.sh Add a local blacklist file --- gravity-adv.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gravity-adv.sh b/gravity-adv.sh index 77646ae5..0df27ef8 100755 --- a/gravity-adv.sh +++ b/gravity-adv.sh @@ -7,10 +7,7 @@ piholeIP="127.0.0.1" # Config file to hold URL rules eventHorizion="/etc/dnsmasq.d/adList.conf" - - - - +blacklist=/etc/pihole/blacklist.txt whitelist=/etc/pihole/whitelist.txt # Create the pihole resource directory if it doesn't exist. Future files will be stored here @@ -38,6 +35,14 @@ curl -s http://someonewhocares.org/hosts/hosts | grep -v "#" | sed '/^$/d' | sed echo "Getting Mother of All Ad Blocks list..." # 102168 domains!! Thanks Kacy curl -A 'Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0' -e http://forum.xda-developers.com/ http://adblock.mahakala.is/ | grep -v "#" | awk '{print $2}' | sort >> /tmp/matter.txt +# Add entries from the local blacklist file if it exists in /etc/pihole directory +if [[ -f $blacklist ]];then + echo "Getting the local blacklist from /etc/pihole directory" + cat /etc/pihole/blacklist.txt >> /tmp/matter.txt +else + echo "No local blacklist.txt file available on /etc/pihole directory" +fi + # Sort the aggregated results and remove any duplicates # Remove entries from the whitelist file if it exists at the root of the current user's home folder if [[ -f $whitelist ]];then