Last active
October 29, 2022 15:40
Star
You must be signed in to star a gist
PeerGuardian Linux (pgl) allowlist cronjob
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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