From d9b66ec3fcf918d3c03e5cf4ce94a8adac8bcfa7 Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Sun, 5 May 2024 15:04:06 +0200 Subject: [PATCH] Add custom dns list --- README.md | 12 ++---------- maza | 9 ++++++++- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 651f318..72b2c83 100644 --- a/README.md +++ b/README.md @@ -163,18 +163,10 @@ maza update ## 🔒 Alternative DNS list -By default the Yoyo DNS list (Peter Lowe) is used (3.7k domains blocked). If you want to use another list, like Steven Black's for example (135k domains blocked, incluyed Yoyo DNS list), you must modify the variable in line 7. - -Replace this line: +By default the Yoyo (Peter Lowe) DNS list is used (3.7k blocked domains). If you want to use another list, such as Steven Black's for example (with 135k blocked domains), you must add the URL of your list on line 8. ``` -URL_DNS_LIST="https://pgl.yoyo.org/adservers/serverlist.php?showintro=0&mimetype=plaintext" -``` - -with this: - -``` -URL_DNS_LIST="https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts" +URL_DNS_LIST_CUSTOM="https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts" ``` ## DNSMASQ diff --git a/maza b/maza index 9e1679a..26b5e73 100755 --- a/maza +++ b/maza @@ -5,6 +5,7 @@ set -e # VARIABLES URL_DNS_LIST="https://pgl.yoyo.org/adservers/serverlist.php?showintro=0&mimetype=plaintext" +URL_DNS_LIST_CUSTOM="" NAME_OSX="Darwin" THIS_OS=$(uname -mrs) PROGNAME=$(basename "$0") @@ -86,13 +87,19 @@ status() { update() { + local local_url_dns_list="$URL_DNS_LIST" # Default + if [ -n "$URL_DNS_LIST_CUSTOM" ]; then + echo "si" + local_url_dns_list="$URL_DNS_LIST_CUSTOM" # Custom + fi + # Make conf folder rm -f "$CONFIG$LIST" rm -f "$CONFIG$LIST_DNSMASQ" mkdir -p "$CONFIG" # Download DNS list - curl -L -s "$URL_DNS_LIST" -o "$CONFIG$LIST" + curl -L -s "$local_url_dns_list" -o "$CONFIG$LIST" ## Remove comments ### Start with # custom-sed -i.bak '/^#/ d' "$CONFIG$LIST"