Skip to content

Instantly share code, notes, and snippets.

Last active Apr 1, 2018
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
# sudo crontab -e
# W="list of domains to be whitelisted"
*/30 * * * * W="" ; for H in $W ; do for H_IP in `dig $H A +short | grep -P "^\d.*"` ; do echo "${H}:${H_IP}-" | 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