From 691baa1702d16e035d054f2ad03f901c61b4cd62 Mon Sep 17 00:00:00 2001 From: jacobsalmela Date: Sat, 11 Oct 2014 15:55:23 -0500 Subject: [PATCH] logic to check for yoyo list --- gravity-adv.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gravity-adv.sh b/gravity-adv.sh index 0b15c410..507ffce1 100755 --- a/gravity-adv.sh +++ b/gravity-adv.sh @@ -6,7 +6,11 @@ eventHorizion="/etc/dnsmasq.d/adList.conf" # Download the original URL to a text file for easier parsing curl -o /tmp/yoyo.txt -s http://pgl.yoyo.org/adservers/serverlist.php?hostformat=unixhosts&mimetype=plaintext -cat /tmp/yoyo.txt | grep -v "<" | sed '/^$/d' | sed 's/\ /\\ /g' | sort > /tmp/matter.txt +if [ -f /tmp/yoyo.txt ];then + cat /tmp/yoyo.txt | grep -v "<" | sed '/^$/d' | sed 's/\ /\\ /g' | sort > /tmp/matter.txt +else + echo "Unable to get yoyo ad list" +fi # Download and append other ad URLs from different sources curl -s http://winhelp2002.mvps.org/hosts.txt | grep -v "#" | grep -v "127.0.0.1" | sed '/^$/d' | sed 's/\ /\\ /g' | awk '{print $2}' | sort >> /tmp/matter.txt @@ -18,7 +22,8 @@ curl -s http://adblock.gjtech.net/?format=unix-hosts | grep -v "#" | sed '/^$/d' # Sort the aggregated results and remove any duplicates cat /tmp/matter.txt | sort | uniq | sed '/^$/d' > /tmp/andLight.txt -# Read the file and prepend "address=/" and append the IP of the Raspberry Pi +# Read the file, prepend "address=/", and append the IP of the Raspberry Pi +# This creates a correctly-formatted config file while read fermion do boson=$(echo "$fermion" | tr -d '\r')