From e83b94f21369bb4ca30f80ff183e2684666081c6 Mon Sep 17 00:00:00 2001 From: Raphael Andres Date: Sat, 2 Jul 2022 17:12:09 +0200 Subject: [PATCH 1/2] specify zone name to reload --- ad-blocker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ad-blocker.sh b/ad-blocker.sh index aba5ea3..df7c076 100755 --- a/ad-blocker.sh +++ b/ad-blocker.sh @@ -186,7 +186,7 @@ update_zone_master () { echo '* IN A 127.0.0.1'; } > "$ZoneMasterFile" # reload the server config to pick up the changes - "${RootDir}"/script/reload.sh + "${RootDir}"/script/reload.sh null.zone.file } # Global vars for common paths From 5b2159c0c4fdf8d64f632e8dee33e7369856ee84 Mon Sep 17 00:00:00 2001 From: Raphael Andres Date: Sat, 2 Jul 2022 17:12:28 +0200 Subject: [PATCH 2/2] specify absolute path to null.zone.file --- ad-blocker.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ad-blocker.sh b/ad-blocker.sh index df7c076..2c3e5d7 100755 --- a/ad-blocker.sh +++ b/ad-blocker.sh @@ -78,7 +78,7 @@ fetch_blocklist () { # the "-O-" tells wget to send the file to standard out instead of a real file # this makes it suitable for piping and eliminates need for another temp file wget -O- "$BlocklistURL" | \ - sed -e 's/null.zone.file/\/etc\/zone\/master\/null.zone.file/g' > "/tmp/ad-blocker.new" + sed -e 's/null.zone.file/\/var\/packages\/DNSServer\/target\/named\/etc\/zone\/master\/null.zone.file/g' > "/tmp/ad-blocker.new" } # user-specified list of domains to be blocked in addition to those from yoyo.org @@ -156,10 +156,10 @@ update_zone_data () { # check for the include statement in the ZoneDataFile # if it is present do nothing, else append the include statement to the ZoneDataFile if [ -f "$ZoneDataDB" ] && [ -f "$ZoneDataFile" ]; then - Matches=$(grep 'include "/etc/zone/data/ad-blocker.db";' "$ZoneDataFile") + Matches=$(grep 'include "'${ZoneDataDir}'/ad-blocker.db";' "$ZoneDataFile") if [ -z "$Matches" ]; then echo '' >> "$ZoneDataFile" - echo 'include "/etc/zone/data/ad-blocker.db";' >> "$ZoneDataFile" + echo 'include "'${ZoneDataDir}'/ad-blocker.db";' >> "$ZoneDataFile" fi fi }