From 5b68b50eed8504d5b36e1b37c146e6e5818eb01a Mon Sep 17 00:00:00 2001 From: daniel v Date: Sat, 28 Feb 2015 21:59:28 -0700 Subject: [PATCH] first try using passwd --- gravity-adv.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gravity-adv.sh b/gravity-adv.sh index 593d81ac..24d2e74c 100755 --- a/gravity-adv.sh +++ b/gravity-adv.sh @@ -7,7 +7,8 @@ piholeIP="127.0.0.1" # Config file to hold URL rules eventHorizion="/etc/dnsmasq.d/adList.conf" -whitelist=$HOME/whitelist.txt +USER_HOME=$(getent passwd $SUDO_USER | cut -d: -f6) +whitelist=$USER_HOME/whitelist.txt echo "Getting yoyo ad list..." # Approximately 2452 domains at the time of writing curl -s -d mimetype=plaintext -d hostformat=unixhosts http://pgl.yoyo.org/adservers/serverlist.php? | sort > /tmp/matter.txt @@ -46,4 +47,4 @@ echo "$numberOfAdsBlocked ad domains blocked." mv /tmp/andLight.txt $eventHorizion # Restart DNS -service dnsmasq restart \ No newline at end of file +service dnsmasq restart