]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/create_unbound_ad_servers.cmd
Apply upstream fix 08968baec1122a58bb90d8f97ad948a75f8a5d69:
[FreeBSD/FreeBSD.git] / contrib / create_unbound_ad_servers.cmd
1 @Echo off\r
2 rem Convert the Yoyo.org anti-ad server listing\r
3 rem into an unbound dns spoof redirection list.\r
4 rem Written by Y.Voinov (c) 2014\r
5 \r
6 rem Note: Wget required!\r
7 \r
8 rem Variables\r
9 set prefix="C:\Program Files (x86)"\r
10 set dst_dir=%prefix%\Unbound\r
11 set work_dir=%TEMP%\r
12 set list_addr="http://pgl.yoyo.org/adservers/serverlist.php?hostformat=nohtml&showintro=1&startdate%5Bday%5D=&startdate%5Bmonth%5D=&startdate%5Byear%5D="\r
13 \r
14 rem Check Wget installed\r
15 for /f "delims=" %%a in ('where wget') do @set wget=%%a\r
16 if /I "%wget%"=="" echo Wget not found. If installed, add path to PATH environment variable. & exit 1\r
17 echo Wget found: %wget%\r
18 \r
19 "%wget%" -O %work_dir%\yoyo_ad_servers %list_addr%\r
20 \r
21 del /Q /F /S %dst_dir%\unbound_ad_servers\r
22 \r
23 for /F "eol=; tokens=*" %%a in (%work_dir%\yoyo_ad_servers) do (\r
24 echo local-zone: %%a redirect>>%dst_dir%\unbound_ad_servers\r
25 echo local-data: "%%a A 127.0.0.1">>%dst_dir%\unbound_ad_servers\r
26 )\r
27 \r
28 echo Done.\r
29 rem  then add an include line to your unbound.conf pointing to the full path of\r
30 rem  the unbound_ad_servers file:\r
31 rem\r
32 rem   include: $dst_dir/unbound_ad_servers\r
33 rem\r