tornet.yml aktualisiert

This commit is contained in:
olli 2023-07-28 14:38:08 +02:00
parent 3edb0bddd9
commit e111dd7cfa

View File

@ -378,6 +378,35 @@
args:
creates: /etc/systemd/system/multi-user.target.wants/dnscrypt-proxy.service
- name: /usr/local/sbin/autoupdate.d/dnscrypt-proxy-blocklist.update
blockinfile:
path: /usr/local/sbin/autoupdate.d/dnscrypt-proxy-blocklist.update
mode: "0400"
owner: root
group: root
create: yes
marker: "# {mark} ANSIBLE MANAGED BLOCK"
block: |
cd /etc/dnscrypt-proxy
# get hosts blocklist from https://github.com/StevenBlack/hosts
g_runcmd wget https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling/hosts -O - | grep "^0\.0\.0\.0 " | cut -d" " -f2 >${g_tmp}/blocked-names.txt
numhosts=$(cat ${g_tmp}/blocked-names.txt | wc -l)
if [ "$numhosts" -gt 200000 ]
then
cat ${g_tmp}/blocked-names.txt >blocked-names.txt
else
g_echo_error "Not enough lines in hosts blocklist from https://github.com/StevenBlack/hosts"
fi
[ -s blocked-names-local-additions.txt ] && cat blocked-names-local-additions.txt >>blocked-names.txt
systemctl restart dnscrypt-proxy
cd -
backup: yes
validate: /bin/bash -n %s
handlers: