Skip to content

Instantly share code, notes, and snippets.

@scrathe
Last active October 29, 2022 15:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save scrathe/9cd18cf8bd29db55c2b1e39fe6024565 to your computer and use it in GitHub Desktop.
PeerGuardian Linux (pgl) allowlist cronjob
# cronjob to monitor domains for IP changes, and add them to PeerGuardian Linux (pgl) allowlist
# https://wiki.archlinux.org/index.php/PeerGuardian_Linux
# sudo crontab -e
# W="list of domains to be allowed"
*/30 * * * * W="site.one site.two site.three" ; 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