Skip to content

Instantly share code, notes, and snippets.

@scrathe
Last active Apr 1, 2018
Embed
What would you like to do?
PeerGuardian Linux (pgl) whitelist cronjob
# cronjob to monitor domains for IP changes, and add them to PeerGuardian Linux (pgl) whitelist
# https://wiki.archlinux.org/index.php/PeerGuardian_Linux
# sudo crontab -e
# W="list of domains to be whitelisted"
*/30 * * * * W="secure.usenetserver.com eunews.blocknews.net www.usenet-crawler.com nzb.in lolo.sickbeard.com newshost.co.za midgetspy.github.com www.nzbstars.com" ; for H in $W ; do for H_IP in `dig $H A +short | grep -P "^\d.*"` ; do echo "${H}:${H_IP}-255.255.255.255" | tee -a '/etc/pgl/allow.txt' ; done ; done && sort /etc/pgl/allow.txt | uniq > /etc/pgl/allow.p2p && service pgl reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment