Add 'update_block_list.sh'

This commit is contained in:
fossilfranv 2023-05-11 10:23:11 -07:00
parent 4931844f74
commit 4e373ce631

23
update_block_list.sh Normal file
View File

@ -0,0 +1,23 @@
#!/bin/bash
cd /etc/dnscrypt-proxy
# download notracking/hosts-blocklists without git for portability
rm master.zip
/usr/bin/wget https://github.com/notracking/hosts-blocklists/archive/refs/heads/master.zip -O master.zip
rm hosts-blocklists-master/*
/usr/bin/unzip -o master.zip
# download oisd blocklist
/usr/bin/wget https://dblw.oisd.nl/ -O hosts-blocklists-master/dnscrypt-proxy/oisd.txt
# combine unique entries
cat hosts-blocklists-master/dnscrypt-proxy/*.txt | uniq -u > blocked-names.txt
# cleanup downloads
rm master.zip hosts-blocklists-master -rf
# restart DNS resolver to apply new blocklist
#systemctl restart dnscrypt-proxy.service
#/usr/bin/pkill dns
#nohup /root/linux-x86_64/dnscrypt-proxy -logf