From 67aba8c49684ef3d643bf893da49245136f59d02 Mon Sep 17 00:00:00 2001 From: rmceoin Date: Fri, 19 Jun 2015 13:31:51 -0700 Subject: [PATCH 1/3] If exists, import a config file to allow for overriding script variables. --- gravity.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gravity.sh b/gravity.sh index 36ab544..2f8993e 100755 --- a/gravity.sh +++ b/gravity.sh @@ -16,8 +16,13 @@ sources=('https://adaway.org/hosts.txt' 'http://winhelp2002.mvps.org/hosts.txt') # Variables for various stages of downloading and formatting the list +adList=/etc/hosts origin=/etc/pihole piholeDir=/etc/pihole +if [ -f $piholeDir/pihole.conf ]; then + . $piholeDir/pihole.conf +fi + justDomainsExtension=domains matter=pihole.0.matter.txt andLight=pihole.1.andLight.txt @@ -25,7 +30,6 @@ supernova=pihole.2.supernova.txt eventHorizon=pihole.3.eventHorizon.txt accretionDisc=pihole.4.accretionDisc.txt eyeOfTheNeedle=pihole.5.wormhole.txt -adList=/etc/hosts blacklist=$piholeDir/blacklist.txt latentBlacklist=$origin/latentBlacklist.txt whitelist=$piholeDir/whitelist.txt @@ -120,4 +124,4 @@ if [[ -f $whitelist ]];then else cat $origin/$matter > $origin/$andLight gravity_advanced -fi \ No newline at end of file +fi From b7e2c8053b5b8935738f0b6cab17fd67242c27f3 Mon Sep 17 00:00:00 2001 From: rmceoin Date: Fri, 19 Jun 2015 14:10:48 -0700 Subject: [PATCH 2/3] Add local-ttl to dnsmasq config so that queries are cached by the requesting device. --- advanced/dnsmasq.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/advanced/dnsmasq.conf b/advanced/dnsmasq.conf index 4340f83..d310b41 100644 --- a/advanced/dnsmasq.conf +++ b/advanced/dnsmasq.conf @@ -6,4 +6,5 @@ server=8.8.4.4 interface=eth0 listen-address=127.0.0.1 cache-size=10000 -log-queries \ No newline at end of file +log-queries +local-ttl=300 From e9324f8316e3d3cfd6f67eceae846e9c82550f72 Mon Sep 17 00:00:00 2001 From: rmceoin Date: Fri, 19 Jun 2015 17:54:12 -0700 Subject: [PATCH 3/3] Use double brackets for the test. --- gravity.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gravity.sh b/gravity.sh index 2f8993e..11b4a21 100755 --- a/gravity.sh +++ b/gravity.sh @@ -19,7 +19,7 @@ sources=('https://adaway.org/hosts.txt' adList=/etc/hosts origin=/etc/pihole piholeDir=/etc/pihole -if [ -f $piholeDir/pihole.conf ]; then +if [[ -f $piholeDir/pihole.conf ]]; then . $piholeDir/pihole.conf fi