Ad blocking
From DD-WRT Wiki
This script, courtesy of several people on the forums, who probably should be named, will enable host-based ad blocking; I tested this on my WRT54GS v4 and WRT54GL v1.0 both running dd-wrt RC5 std.
Current uptime is 11 days, memory hovers around 700kb free (14108 avail), was approximately 2000kb free before the script:
<code> logger WAN UP Script Executing sleep 5 test -s /tmp/dlhosts if [ $? == 1 ] ; then echo -e "#!/bin/sh\nwget -O - http://www.mvps.org/winhelp2002/hosts.txt | grep 127.0.0.1 | sed -e '2,\$s/127.0.0.1/0.0.0.0/g' -e 's/[[:space:]]*#.*$//' > /tmp/hosts\nlogger DOWNLOADED http://www.mvps.org/winhelp2002/hosts.txt\nkillall -1 dnsmasq" > /tmp/dlhosts chmod 777 /tmp/dlhosts /tmp/dlhosts fi ln -s /tmp/hosts /etc/hosts echo "45 23 * * 5 root /tmp/dlhosts" >> /tmp/crontab </code>
Enable DNSMasq and Local DNS in Services tab; no Additional DNSMasq options necessary.
Ensure cron is enabled.