forked from mrrfv/cloudflare-gateway-pihole-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_recommended_filters.sh
31 lines (27 loc) · 1.16 KB
/
get_recommended_filters.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# create an empty input.csv file
touch input.csv
# declare an array of urls
urls=(
https://raw.githubusercontent.com/mullvad/dns-blocklists/main/output/doh/doh_adblock.txt
https://raw.githubusercontent.com/mullvad/dns-blocklists/main/output/doh/doh_gambling.txt
https://raw.githubusercontent.com/mullvad/dns-blocklists/main/output/doh/doh_privacy.txt
https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Risk/hosts
https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Alternate%20versions%20Anti-Malware%20List/AntiMalwareHosts.txt
https://adaway.org/hosts.txt
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
)
# loop through the urls and download each file with curl
for url in "${urls[@]}"; do
# get the file name from the url
file=$(basename "$url")
# download the file with curl and save it as file.txt
curl -o "$file.txt" "$url"
# append the file contents to input.csv and add a newline
cat "$file.txt" >> input.csv
echo "" >> input.csv
# remove the file.txt
rm "$file.txt"
done
# print a message when done
echo "Done. The input.csv file contains merged data from recommended filter lists."