Browse Source

generate_blocklist: make URLs configurable

master
Peter Cai 1 year ago
parent
commit
9dca8f1a89
  1. 3
      .gitignore
  2. 10
      generate_blocklist.sh

3
.gitignore vendored

@ -5,4 +5,5 @@
/dist
/worker
/config.json
/blocklist.txt
/blocklist.txt
/blocklist_config.sh

10
generate_blocklist.sh

@ -5,10 +5,12 @@ function import_hosts() {
curl "$url" | sed '/^#/d' | sed 's/0.0.0.0 //g' | sed 's/127.0.0.1 //g' | grep '\S'
}
URLS=(
"https://someonewhocares.org/hosts/zero/hosts"
"https://adaway.org/hosts.txt"
)
# In blocklist_config, put a list of URLs to shared ad-blocking hosts files
# e.g.
# URL=(
# "https://some-domain/hosts"
#)
. ./blocklist_config.sh
echo "" > blocklist.txt
for url in ${URLS[@]}; do

Loading…
Cancel
Save