StevenBlack hosts

StevenBlack hosts


Блокировка нежелательного контента посредством подмены NS записей на OpenWrt.
За основу взят репозиторий https://github.com/StevenBlack/hosts

/gethosts.sh
#!/bin/bash
/usr/bin/curl -s https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts -o /tmp/sbhosts
sed -i '/^127./,/.0.0$/d' /tmp/sbhosts
sed -i /^#/d /tmp/sbhosts
sed -i '/^$/d' /tmp/sbhosts

/bin/echo "100.100.100.97 retracker.local" >> /tmp/sbhosts
/bin/echo "100.100.100.98 retracker.local" >> /tmp/sbhosts
/bin/echo "100.100.100.99 retracker.local" >> /tmp/sbhosts
/bin/echo "100.100.100.100 retracker.local" >> /tmp/sbhosts

/etc/init.d/dnsmasq reload


/etc/crontabs/root
@reboot         /gethosts.sh
0 * * * * /gethosts.sh


/etc/config/dhcp
...
config dnsmasq
...
list addnhosts '/tmp/sbhosts'
...


/etc/sysupgrade.conf
/gethosts.sh

Содержание