Hello all, I was checking the script in subject, which is used to
generate a "blocklist" and noticed that it needs "wget" installed
now, Windows, at least from version 10 carries the "curl" utility
which comes installed by defailt, so the script could be modified
to use such a tool w/o the need for external dependencies, and it
goes the same for the "warmup.cmd" which uses "dig", it could be
modified to use the windows native "nslookup" tool
Last, the scripts may use the command "cd /D %~dp0" to move to the
drive/folder where the script resides and then just use the "%CD%"
environment variable to obtain the "base" folder
HTH
Hello all, I was checking the script in subject
forgive me, was referring to "create_unbound_ad_servers.cmd"
:: On Mon, 19 Aug 2024 16:02:25 +0200
:: <20240819160225.000062c7@gmx.net>
> Hello all, I was checking the script in subject
forgive me, was referring to "create_unbound_ad_servers.cmd"
here's an example showing how the script could be simplified and
slightly improved
@echo off
cd /D %~dp0
setlocal
:
SET SRCURL="https://pgl.yoyo.org/adservers/serverlist.php?hostformat=unbound&showintro=0&mimetype=plaintext"
SET TMPFIL=block.temp
set BLKFIL=block.zone
set CFGFIL=%CD%\service.conf
:
del /F /Q %TMPFIL% >NUL 2>&1
curl -o %TMPFIL% %SRCURL%
if errorlevel 1 goto QUIT
:
copy /Y %TMPFIL% %BLKFIL%
del /F /Q %TMPFIL% >NUL 2>&1
unbound-control -c "%CFGFIL%" -s 127.0.0.1 reload
:
:QUIT
exit %ERRORLEVEL%
the above assumes that the "blocklist" is contained into a file named
"block.zone", the script fetches the updated zone to a temporary file
using "curl", then if all ok, copies the temp file to the zone file and
uses "unbound-control" to tell unbound to reload the config and the
zones so applying the update, the URL is modified so that the source
site returns the zone data directly in unbound zone format, so that it
doesn't need to be further manipulated