Blocklist for dnsmasq.
- Log into your Edgerouter
- Grant yourself superuser permissions using
sudo -i
- Add the following contents to this file:
/config/user-data/update-adblock-dnsmasq.sh
(vi
should be available)#!/usr/bin/env bash set -euo pipefail AD_LIST_URL="https://jkpl.gitlab.io/blocklist/blocklist.txt" AD_FILE="/etc/dnsmasq.d/dnsmasq.adlist.conf" TEMP_AD_FILE="/etc/dnsmasq.d/dnsmasq.adlist.conf.tmp" curl -sSfL -o "$TEMP_AD_FILE" "$AD_LIST_URL" if [ -f "$TEMP_AD_FILE" ] then mv "$TEMP_AD_FILE" "$AD_FILE" else echo "Failed to build the ad list" exit 1 fi systemctl restart dnsmasq
- Make the file executable:
chmod +x /config/user-data/update-adblock-dnsmasq.sh
- Run it:
/config/user-data/update-adblock-dnsmasq.sh
- Schedule it with cron:
(crontab -l ; echo "56 4 * * 6 /config/user-data/update-adblock-dnsmasq.sh") | crontab -
- Logout
MIT License. See LICENSE for more information.