Skip to content

Instantly share code, notes, and snippets.

@NotoriousPyro
Last active April 26, 2025 00:55
Show Gist options
  • Save NotoriousPyro/efaf812936477fd3a4806ced2db778b3 to your computer and use it in GitHub Desktop.
Save NotoriousPyro/efaf812936477fd3a4806ced2db778b3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
blocklist="http://pgl.yoyo.org/adservers/serverlist.php?hostformat=squid-dstdom-regex&showintro=0&startdate%5Bday%5D=&startdate%5Bmonth%5D=&startdate%5Byear%5D=&mimetype=plaintext"
blocklist_savefile="/etc/squid/adblock.list"
printf "Retrieving block list... "
curl -sSL "$blocklist" > $blocklist_savefile && printf "Done\n\n"
printf "Reloading squid... "
squid -k reconfigure && printf "Done\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment