Skip to content

Instantly share code, notes, and snippets.

@Cybso
Cybso / adblock.sh
Last active September 3, 2021 18:07 — forked from teffalump/README.md
#!/bin/sh
#Put in /etc/adblock.sh
#Script to grab and sort a list of adservers and malware
#Check proper DHCP config and, if necessary, update it
uci get dhcp.@dnsmasq[0].addnhosts > /dev/null 2>&1 || uci add_list dhcp.@dnsmasq[0].addnhosts=/etc/block.hosts && uci commit
#Leave crontab alone, or add to it
grep -q "/etc/adblock.sh" /etc/crontabs/root || echo "0 4 * * 0,3 sh /etc/adblock.sh" >> /etc/crontabs/root