Skip to content

Instantly share code, notes, and snippets.

@Anachron
Forked from abenson/etc.dnsmasq.conf
Created August 26, 2018 17:34
Show Gist options
  • Save Anachron/79c3aea64bb346dd088bdac1aa0c6e43 to your computer and use it in GitHub Desktop.
Save Anachron/79c3aea64bb346dd088bdac1aa0c6e43 to your computer and use it in GitHub Desktop.
adblock setup
#!/bin/sh
exec snooze -d 2/5 /usr/local/bin/update-adblock
#!/bin/sh
FILE=$(mktemp)
touch $FILE
URLS="https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
https://raw.githubusercontent.com/notracking/hosts-blocklists/master/hostnames.txt"
for url in $URLS; do
echo $url
curl -sL "$url" | grep '^0' >> $FILE
done
sort -u $FILE > /etc/hosts.adblock
chown root:root /etc/hosts.adblock
chmod 0644 /etc/hosts.adblock
rm $FILE
sv reload dnsmasq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment