Created
September 17, 2013 14:02
-
-
Save Weeker/6594726 to your computer and use it in GitHub Desktop.
ad-blocking on route
http://thruth.ixiezi.com/2012/10/17/ad-blocking-on-ddwrt-router/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| logger WAN up script executing | |
| if test -s /tmp/dnsmasq.ads | |
| then | |
| rm /tmp/dnsmasq.ads | |
| fi | |
| logger Downloading China Lazy List | |
| wget -O - http://adblock-chinalist.googlecode.com/svn/trunk/adblock-lazy.txt | | |
| grep ^\|\|[^\*]*\^$ | | |
| sed -e 's:||:address\=\/:' -e 's:\^:/127\.0\.0\.1:' > /tmp/dnsmasq.ads | |
| grep conf-file /tmp/dnsmasq.conf || | |
| echo -e "\nconf-file=/tmp/dnsmasq.ads" >> /tmp/dnsmasq.conf | |
| logger Restarting dnsmasq | |
| killall dnsmasq | |
| dnsmasq --conf-file=/tmp/dnsmasq.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment