Skip to content

Instantly share code, notes, and snippets.

@LaurentFough
Forked from vbezhenar/blacklist-update.sh
Created January 24, 2016 03:51
Show Gist options
  • Save LaurentFough/8133be04d1ed2903f36e to your computer and use it in GitHub Desktop.
Save LaurentFough/8133be04d1ed2903f36e to your computer and use it in GitHub Desktop.
#!/bin/sh
url='http://pgl.yoyo.org/as/serverlist.php?hostformat=nohtml'
ftp -o - "$url" | awk '{printf "local-zone: \"%s.\" static\n", $1}' > /var/unbound/etc/blacklist.conf.new || exit $?
mv /var/unbound/etc/blacklist.conf.new /var/unbound/etc/blacklist.conf
rcctl reload unbound
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment