mirror of
https://github.com/tanrax/maza-ad-blocking.git
synced 2024-11-10 02:15:42 +01:00
Add ignore domain list
This commit is contained in:
parent
c4c84b1474
commit
50eb9863ef
24
README.md
24
README.md
@ -94,6 +94,29 @@ Add the following line at the end.
|
|||||||
sudo rm /usr/local/bin/maza && sudo rm -r ~/.maza
|
sudo rm /usr/local/bin/maza && sudo rm -r ~/.maza
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 🚫 Not blocking certain domains
|
||||||
|
|
||||||
|
Create a file named `ignore` inside the Maza configuration folder.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
touch ~/.maza/ignore
|
||||||
|
```
|
||||||
|
|
||||||
|
Edit the file for all domains that you do not want to ignore with a line break.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
``` txt
|
||||||
|
ads-twitter.com
|
||||||
|
ads.twitter.com
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally update Maza to apply the changes.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
maza update
|
||||||
|
```
|
||||||
|
|
||||||
## 🔒 Alternative DNS list
|
## 🔒 Alternative DNS list
|
||||||
|
|
||||||
By default the Yoyo DNS list (Peter Lowe) is used. If you want to use another list, like Steven Black's for example, you must modify the variable in line 7.
|
By default the Yoyo DNS list (Peter Lowe) is used. If you want to use another list, like Steven Black's for example, you must modify the variable in line 7.
|
||||||
@ -292,4 +315,3 @@ Remember to make a backup copy of `/etc/hosts` in case of unforeseen circumstanc
|
|||||||
## 🧑🎨 Credits
|
## 🧑🎨 Credits
|
||||||
|
|
||||||
<a target="_blank" href="https://andros.dev/">Andros Fenollosa</a>
|
<a target="_blank" href="https://andros.dev/">Andros Fenollosa</a>
|
||||||
|
|
||||||
|
8
maza
8
maza
@ -15,6 +15,7 @@ COLOR_GREEN=$(tput setaf 2)
|
|||||||
COLOR_RESET=$(tput sgr0)
|
COLOR_RESET=$(tput sgr0)
|
||||||
LIST="list"
|
LIST="list"
|
||||||
LIST_DNSMASQ="dnsmasq.conf"
|
LIST_DNSMASQ="dnsmasq.conf"
|
||||||
|
IGNORE_LIST_FILE="ignore"
|
||||||
START_TAG="## MAZA - List ad blocking"
|
START_TAG="## MAZA - List ad blocking"
|
||||||
PROJECT="### https://github.com/tanrax/maza-ad-blocking"
|
PROJECT="### https://github.com/tanrax/maza-ad-blocking"
|
||||||
AUTHOR="### Created by Andros Fenollosa (https://andros.dev/)"
|
AUTHOR="### Created by Andros Fenollosa (https://andros.dev/)"
|
||||||
@ -97,6 +98,13 @@ update() {
|
|||||||
custom-sed -i.bak "1i\\$START_TAG" "$CONFIG$LIST_DNSMASQ"
|
custom-sed -i.bak "1i\\$START_TAG" "$CONFIG$LIST_DNSMASQ"
|
||||||
## Add end tag DNS DNSMASQ in first line
|
## Add end tag DNS DNSMASQ in first line
|
||||||
echo "$END_TAG" >> "$CONFIG$LIST_DNSMASQ"
|
echo "$END_TAG" >> "$CONFIG$LIST_DNSMASQ"
|
||||||
|
# Remove the domains to ignore. They are located in ".maza/ignore"
|
||||||
|
if [ -f "$CONFIG/$IGNORE_LIST_FILE" ]; then
|
||||||
|
while IFS= read -r domain; do
|
||||||
|
custom-sed -i.bak "/$domain/d" "$CONFIG$LIST"
|
||||||
|
custom-sed -i.bak "/$domain/d" "$CONFIG$LIST_DNSMASQ"
|
||||||
|
done < "$CONFIG/$IGNORE_LIST_FILE"
|
||||||
|
fi
|
||||||
# Remove temp file
|
# Remove temp file
|
||||||
rm "$CONFIG$LIST.bak"
|
rm "$CONFIG$LIST.bak"
|
||||||
rm "$CONFIG$LIST_DNSMASQ.bak"
|
rm "$CONFIG$LIST_DNSMASQ.bak"
|
||||||
|
Loading…
Reference in New Issue
Block a user