From 29ae57465bbbf06606894278cda84ad8df08f15f Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Wed, 25 Nov 2015 19:51:07 -0800 Subject: [PATCH] Bug Fix - Cleanup Files --- gravity.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gravity.sh b/gravity.sh index ae20d439..d70f0dce 100755 --- a/gravity.sh +++ b/gravity.sh @@ -145,7 +145,7 @@ function gravity_Schwarzchild() { echo "** Aggregating list of domains..." truncate -s 0 $piholeDir/$matter for i in "${activeDomains[@]}" -do +do cat $i |tr -d '\r' >> $piholeDir/$matter done @@ -199,6 +199,16 @@ function gravity_hostFormat() { # Copy the file over as /etc/pihole/gravity.list so dnsmasq can use it cp $piholeDir/$accretionDisc $adList } +function gravity_blackbody() { + for file in $piholeDir/*.$justDomainsExtension + do + if [[ " ${activeDomains[@]} " =~ " ${file} " ]]; then + : + else + rm -f $file + fi + done +} function gravity_advanced() { # Remove comments and print only the domain name @@ -221,4 +231,4 @@ gravity_Schwarzchild gravity_pulsar gravity_hostFormat gravity_advanced - +gravity_blackbody