#!/usr/bin/env bash function log() { echo -e "\033[33m$@\033[0m" } log "Preparing database…" ./database.py --refresh log "Compiling rules…" cat rules_adblock/*.txt | grep -v '^!' | grep -v '^\[Adblock' | ./adblock_to_domain_list.py | ./feed_rules.py subdomains cat rules_hosts/*.txt | grep -v '^#' | grep -v '^$' | cut -d ' ' -f2 | ./feed_rules.py subdomains cat rules/*.list | grep -v '^#' | grep -v '^$' | ./feed_rules.py subdomains cat rules_ip/*.txt | grep -v '^#' | grep -v '^$' | ./feed_rules.py ip4network # NOTE: Ensure first-party sources are last cat rules/first-party.list | grep -v '^#' | grep -v '^$' | ./feed_rules.py subdomains --first-party cat rules_ip/first-party.txt | grep -v '^#' | grep -v '^$' | ./feed_rules.py ip4network --first-party # log "Reading A records…" # pv a.json.gz | gunzip | ./feed_dns.py # log "Reading CNAME records…" # pv cname.json.gz | gunzip | ./feed_dns.py