Geoffrey Frogeye
69b82d29fd
Rules can now come in 3 different formats: - AdBlock rules - Host lists - Domains lists All will be converted into domain lists and aggregated (only AdBlock rules matching a whole domain will be kept). Subdomains will now be matched if it is a subdomain of any domain of the rule. It is way faster (seconds rather than hours!) but less flexible (although it shouldn't be a problem).
30 lines
848 B
Bash
Executable file
30 lines
848 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
function dl() {
|
|
echo "Downloading $1 to $2..."
|
|
curl --silent "$1" > "$2"
|
|
if [ $? -ne 0 ]
|
|
then
|
|
echo "Failed!"
|
|
fi
|
|
}
|
|
|
|
# Get rules
|
|
dl https://easylist.to/easylist/easyprivacy.txt rules_adblock/easyprivacy.cache.txt
|
|
dl https://raw.githubusercontent.com/StevenBlack/hosts/master/data/add.2o7Net/hosts rules_hosts/add2o7.cache.txt
|
|
|
|
# Get a list of nameservers
|
|
rm -f nameservers
|
|
touch nameservers
|
|
[ -f nameservers.head ] && cat nameservers.head >> nameservers
|
|
dl https://public-dns.info/nameservers.txt nameservers.temp
|
|
sort -R nameservers.temp >> nameservers
|
|
rm nameservers.temp
|
|
|
|
# Get top 1M subdomains
|
|
wget http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip
|
|
unzip top-1m.csv.zip
|
|
sed 's|^[0-9]\+,||' top-1m.csv > subdomains/cisco-umbrella_popularity.cache.list
|
|
rm top-1m.csv top-1m.csv.zip
|
|
|