http://wiki.dd-wrt.com/wiki/index.php?title=Ad_blocking&action=history&feed=atom Ad blocking - Revision history 2024-03-28T18:02:30Z Revision history for this page on the wiki MediaWiki 1.10.1 http://wiki.dd-wrt.com/wiki/index.php?title=Ad_blocking&diff=55725&oldid=prev Tag: /* Ad Blocking with builds other than Micro */ Update mvps.org hosts file URL 2020-09-03T08:34:48Z <p><span class="autocomment">Ad Blocking with builds other than Micro -</span> Update mvps.org hosts file URL</p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 08:34, 3 September 2020</td> </tr> <tr><td colspan="2" align="left"><strong>Line 18:</strong></td> <td colspan="2" align="left"><strong>Line 18:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">fi</td><td> </td><td style="background: #eee; font-size: smaller;">fi</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">logger Downloading http://<del style="color: red; font-weight: bold; text-decoration: none;">www</del>.mvps.org<del style="color: red; font-weight: bold; text-decoration: none;">/winhelp2002</del>/hosts.txt</td><td>+</td><td style="background: #cfc; font-size: smaller;">logger Downloading http://<ins style="color: red; font-weight: bold; text-decoration: none;">winhelp2002</ins>.mvps.org/hosts.txt</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">wget -O - http://<del style="color: red; font-weight: bold; text-decoration: none;">www</del>.mvps.org<del style="color: red; font-weight: bold; text-decoration: none;">/winhelp2002</del>/hosts.txt | grep 0.0.0.0 |</td><td>+</td><td style="background: #cfc; font-size: smaller;">wget -O - http://<ins style="color: red; font-weight: bold; text-decoration: none;">winhelp2002</ins>.mvps.org/hosts.txt | grep 0.0.0.0 |</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> sed 's/[[:space:]]*#.*$//g;' |</td><td> </td><td style="background: #eee; font-size: smaller;"> sed 's/[[:space:]]*#.*$//g;' |</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> grep -v localhost | tr ' ' '\t' |</td><td> </td><td style="background: #eee; font-size: smaller;"> grep -v localhost | tr ' ' '\t' |</td></tr> </table> Tag http://wiki.dd-wrt.com/wiki/index.php?title=Ad_blocking&diff=55025&oldid=prev Atatob: Add languages menu 2019-12-04T01:39:06Z <p>Add languages menu</p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 01:39, 4 December 2019</td> </tr> <tr><td colspan="2" align="left"><strong>Line 1:</strong></td> <td colspan="2" align="left"><strong>Line 1:</strong></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">{{Languages|Ad_blocking}}</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">=Ad Blocking with builds other than Micro=</td><td> </td><td style="background: #eee; font-size: smaller;">=Ad Blocking with builds other than Micro=</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> </table> Atatob http://wiki.dd-wrt.com/wiki/index.php?title=Ad_blocking&diff=49591&oldid=prev TaeBoX: /* Ad Blocking with builds other than Micro */ 2015-04-25T04:09:42Z <p><span class="autocomment">Ad Blocking with builds other than Micro</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 04:09, 25 April 2015</td> </tr> <tr><td colspan="2" align="left"><strong>Line 1:</strong></td> <td colspan="2" align="left"><strong>Line 1:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">=Ad Blocking with builds other than Micro=</td><td> </td><td style="background: #eee; font-size: smaller;">=Ad Blocking with builds other than Micro=</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">This script, courtesy of several people on the forums, who probably should be named, will enable host-based ad blocking via <del style="color: red; font-weight: bold; text-decoration: none;">dns</del>.</td><td>+</td><td style="background: #cfc; font-size: smaller;">This script, courtesy of several people on the forums, who probably should be named, will enable host-based ad blocking via <ins style="color: red; font-weight: bold; text-decoration: none;">DNS</ins>.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> </td><td> </td><td style="background: #eee; font-size: smaller;"> </td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">Maybe this script will not work on every device or it might crash your router when <del style="color: red; font-weight: bold; text-decoration: none;">ther </del>is not enough free ram.</td><td>+</td><td style="background: #cfc; font-size: smaller;">Maybe this script will not work on every device or it might crash your router when <ins style="color: red; font-weight: bold; text-decoration: none;">there </ins>is not enough free ram.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Just put this script into &quot;Startup&quot;:</td><td> </td><td style="background: #eee; font-size: smaller;">Just put this script into &quot;Startup&quot;:</td></tr> <tr><td colspan="2" align="left"><strong>Line 17:</strong></td> <td colspan="2" align="left"><strong>Line 17:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">logger Downloading http://www.mvps.org/winhelp2002/hosts.txt</td><td> </td><td style="background: #eee; font-size: smaller;">logger Downloading http://www.mvps.org/winhelp2002/hosts.txt</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">wget -O - http://www.mvps.org/winhelp2002/hosts.txt | grep <del style="color: red; font-weight: bold; text-decoration: none;">127</del>.0.0.<del style="color: red; font-weight: bold; text-decoration: none;">1 </del>|</td><td>+</td><td style="background: #cfc; font-size: smaller;">wget -O - http://www.mvps.org/winhelp2002/hosts.txt | grep <ins style="color: red; font-weight: bold; text-decoration: none;">0</ins>.0.0.<ins style="color: red; font-weight: bold; text-decoration: none;">0 </ins>|</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> sed '<del style="color: red; font-weight: bold; text-decoration: none;">2,$s/127.0.0.1/0.0.0.0/g; </del>s/[[:space:]]*#.*$//g;' |</td><td>+</td><td style="background: #cfc; font-size: smaller;"> sed 's/[[:space:]]*#.*$//g;' |</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> grep -v localhost | tr ' ' '\t' |</td><td> </td><td style="background: #eee; font-size: smaller;"> grep -v localhost | tr ' ' '\t' |</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> tr -s '\t' | tr -d '\015' | sort -u &gt;/tmp/hosts0</td><td> </td><td style="background: #eee; font-size: smaller;"> tr -s '\t' | tr -d '\015' | sort -u &gt;/tmp/hosts0</td></tr> <tr><td colspan="2" align="left"><strong>Line 37:</strong></td> <td colspan="2" align="left"><strong>Line 37:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Ensure cron is enabled.</td><td> </td><td style="background: #eee; font-size: smaller;">Ensure cron is enabled.</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"></td><td colspan="2">&nbsp;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">/// This no longer works with the current lists downloaded (Jan 2015) /// keithg</td><td colspan="2">&nbsp;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">You may took alternately this script.</td><td> </td><td style="background: #eee; font-size: smaller;">You may took alternately this script.</td></tr> </table> TaeBoX http://wiki.dd-wrt.com/wiki/index.php?title=Ad_blocking&diff=47952&oldid=prev Keithg: /* Ad Blocking with builds other than Micro */ 2015-01-04T07:23:41Z <p><span class="autocomment">Ad Blocking with builds other than Micro</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 07:23, 4 January 2015</td> </tr> <tr><td colspan="2" align="left"><strong>Line 37:</strong></td> <td colspan="2" align="left"><strong>Line 37:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Ensure cron is enabled.</td><td> </td><td style="background: #eee; font-size: smaller;">Ensure cron is enabled.</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">/// This no longer works with the current lists downloaded (Jan 2015) /// keithg</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">You may took alternately this script.</td><td> </td><td style="background: #eee; font-size: smaller;">You may took alternately this script.</td></tr> </table> Keithg http://wiki.dd-wrt.com/wiki/index.php?title=Ad_blocking&diff=47621&oldid=prev Uudruid74: /* Ad Blocking with builds other than Micro */ 2014-10-06T22:47:50Z <p><span class="autocomment">Ad Blocking with builds other than Micro</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 22:47, 6 October 2014</td> </tr> <tr><td colspan="2" align="left"><strong>Line 213:</strong></td> <td colspan="2" align="left"><strong>Line 213:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">The script works on 32 MB-RAM devices and DIDN'T work on 16 MB-RAM devices! On 16 MB-RAM devices please remove the last download link: http://www.hostsfile.org/Downloads/hosts.txt.</td><td> </td><td style="background: #eee; font-size: smaller;">The script works on 32 MB-RAM devices and DIDN'T work on 16 MB-RAM devices! On 16 MB-RAM devices please remove the last download link: http://www.hostsfile.org/Downloads/hosts.txt.</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">'''Warning''' This script is about 5K. Storing it to your firewall script means putting it in your NVRAM. Check to see how much free NVRAM you have. If you don't have enough, you have use jffs or smbfs to remotely mount the script and then call it from the firewall script stored in NVRAM. If you overflow your NVRAM, expect random behavior.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">=Ad Blocking with Micro build=</td><td> </td><td style="background: #eee; font-size: smaller;">=Ad Blocking with Micro build=</td></tr> </table> Uudruid74 http://wiki.dd-wrt.com/wiki/index.php?title=Ad_blocking&diff=45585&oldid=prev Gohat: /* Ad Blocking with builds other than Micro */ 2013-10-14T10:09:39Z <p><span class="autocomment">Ad Blocking with builds other than Micro</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 10:09, 14 October 2013</td> </tr> <tr><td colspan="2" align="left"><strong>Line 211:</strong></td> <td colspan="2" align="left"><strong>Line 211:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">You may add other URLs to the list. You may be inspired by Ad-Away. See: [https://github.com/dschuermann/ad-away/wiki/HostsSources Ad-Away-Wiki]. Keep in mind: your routers memory limits.</td><td> </td><td style="background: #eee; font-size: smaller;">You may add other URLs to the list. You may be inspired by Ad-Away. See: [https://github.com/dschuermann/ad-away/wiki/HostsSources Ad-Away-Wiki]. Keep in mind: your routers memory limits.</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">The script works on 32 MB-RAM devices and DIDN'T work on 16 MB-RAM devices! On 16 MB-RAM devices please remove the last download link: http://www.hostsfile.org/Downloads/hosts.txt.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">=Ad Blocking with Micro build=</td><td> </td><td style="background: #eee; font-size: smaller;">=Ad Blocking with Micro build=</td></tr> </table> Gohat http://wiki.dd-wrt.com/wiki/index.php?title=Ad_blocking&diff=45559&oldid=prev Gohat: /* Ad Blocking with builds other than Micro */ 2013-10-10T19:40:06Z <p><span class="autocomment">Ad Blocking with builds other than Micro</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 19:40, 10 October 2013</td> </tr> <tr><td colspan="2" align="left"><strong>Line 43:</strong></td> <td colspan="2" align="left"><strong>Line 43:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;</td><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"># --- COPY THE TEXT BELOW TO DD-WRT / ADMINISTRATION / COMMANDS then click SAVE FIREWALL ---</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">BH_SCRIPT=&quot;/tmp/blocking_hosts.sh&quot;</td><td> </td><td style="background: #eee; font-size: smaller;">BH_SCRIPT=&quot;/tmp/blocking_hosts.sh&quot;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">BH_WHITELIST=&quot;/tmp/blocking_hosts.whitelist&quot;</td><td> </td><td style="background: #eee; font-size: smaller;">BH_WHITELIST=&quot;/tmp/blocking_hosts.whitelist&quot;</td></tr> </table> Gohat http://wiki.dd-wrt.com/wiki/index.php?title=Ad_blocking&diff=45558&oldid=prev Gohat: /* Ad Blocking with builds other than Micro */ 2013-10-10T19:39:04Z <p><span class="autocomment">Ad Blocking with builds other than Micro</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 19:39, 10 October 2013</td> </tr> <tr><td colspan="2" align="left"><strong>Line 43:</strong></td> <td colspan="2" align="left"><strong>Line 43:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;</td><td> </td><td style="background: #eee; font-size: smaller;">&lt;pre&gt;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"># --- COPY THE TEXT BELOW TO DD-WRT / ADMINISTRATION / COMMANDS then click SAVE FIREWALL ---</td><td colspan="2">&nbsp;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">BH_SCRIPT=&quot;/tmp/blocking_hosts.sh&quot;</td><td> </td><td style="background: #eee; font-size: smaller;">BH_SCRIPT=&quot;/tmp/blocking_hosts.sh&quot;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">BH_WHITELIST=&quot;/tmp/blocking_hosts.whitelist&quot;</td><td> </td><td style="background: #eee; font-size: smaller;">BH_WHITELIST=&quot;/tmp/blocking_hosts.whitelist&quot;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">logger &quot;Download blocking hosts file and restart dnsmasq ...&quot;</td><td> </td><td style="background: #eee; font-size: smaller;">logger &quot;Download blocking hosts file and restart dnsmasq ...&quot;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"># Create whitelist.</td><td>+</td><td style="background: #cfc; font-size: smaller;"># Create whitelist<ins style="color: red; font-weight: bold; text-decoration: none;">. The whitelist entries will be removed from the</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"># hosts files, i.e. blacklist files</ins>.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">cat &gt; &quot;$BH_WHITELIST&quot; &lt;&lt;EOF</td><td> </td><td style="background: #eee; font-size: smaller;">cat &gt; &quot;$BH_WHITELIST&quot; &lt;&lt;EOF</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">localhost\\.localdomain</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">local</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">invalid</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">whitelist-example\\.com</td><td> </td><td style="background: #eee; font-size: smaller;">whitelist-example\\.com</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">.*\\.whitelist-example\\.com</td><td> </td><td style="background: #eee; font-size: smaller;">.*\\.whitelist-example\\.com</td></tr> <tr><td colspan="2" align="left"><strong>Line 79:</strong></td> <td colspan="2" align="left"><strong>Line 82:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> }</td><td> </td><td style="background: #eee; font-size: smaller;"> }</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> else {</td><td> </td><td style="background: #eee; font-size: smaller;"> else {</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> <del style="color: red; font-weight: bold; text-decoration: none;">whitelist</del>[++n_whitelist] = \$0</td><td>+</td><td style="background: #cfc; font-size: smaller;"> <ins style="color: red; font-weight: bold; text-decoration: none;">a_whitelist</ins>[++n_whitelist] = \$0</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> }</td><td> </td><td style="background: #eee; font-size: smaller;"> }</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> }</td><td> </td><td style="background: #eee; font-size: smaller;"> }</td></tr> <tr><td colspan="2" align="left"><strong>Line 85:</strong></td> <td colspan="2" align="left"><strong>Line 88:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> # Setup record sparator.</td><td> </td><td style="background: #eee; font-size: smaller;"> # Setup record sparator.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> RS=&quot; +&quot;</td><td> </td><td style="background: #eee; font-size: smaller;"> RS=&quot; +&quot;</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> c = 0</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> }</td><td> </td><td style="background: #eee; font-size: smaller;"> }</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> {</td><td> </td><td style="background: #eee; font-size: smaller;"> {</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> c = 0</td><td colspan="2">&nbsp;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> for ( n = 1; \$n != &quot;&quot;; n++ ) {</td><td> </td><td style="background: #eee; font-size: smaller;"> for ( n = 1; \$n != &quot;&quot;; n++ ) {</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> # Check whitelist.</td><td> </td><td style="background: #eee; font-size: smaller;"> # Check whitelist.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> whitelist_flag = 0</td><td> </td><td style="background: #eee; font-size: smaller;"> whitelist_flag = 0</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> for ( w = 1; w &lt;= n_whitelist; w++ ) {</td><td> </td><td style="background: #eee; font-size: smaller;"> for ( w = 1; w &lt;= n_whitelist; w++ ) {</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> if ( \$n ~ ( &quot;^&quot; <del style="color: red; font-weight: bold; text-decoration: none;">whitelist</del>[w] &quot;\$&quot; ) ) {</td><td>+</td><td style="background: #cfc; font-size: smaller;"> if ( \$n ~ ( &quot;^&quot; <ins style="color: red; font-weight: bold; text-decoration: none;">a_whitelist</ins>[w] &quot;\$&quot; ) ) {</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> whitelist_flag = 1</td><td> </td><td style="background: #eee; font-size: smaller;"> whitelist_flag = 1</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> break</td><td> </td><td style="background: #eee; font-size: smaller;"> break</td></tr> <tr><td colspan="2" align="left"><strong>Line 98:</strong></td> <td colspan="2" align="left"><strong>Line 101:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> }</td><td> </td><td style="background: #eee; font-size: smaller;"> }</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> if ( whitelist_flag == 0 ) {</td><td> </td><td style="background: #eee; font-size: smaller;"> if ( whitelist_flag == 0 ) {</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><del style="color: red; font-weight: bold; text-decoration: none;"> c += 1</del></td><td>+</td><td style="background: #cfc; font-size: smaller;"> hosts[<ins style="color: red; font-weight: bold; text-decoration: none;">++</ins>c] = \$n</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> hosts[c] = \$n</td><td>+</td><td style="background: #cfc; font-size: smaller;"> if ( c == <ins style="color: red; font-weight: bold; text-decoration: none;">10 </ins>) {</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> if ( c == <del style="color: red; font-weight: bold; text-decoration: none;">5 </del>) {</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> s_hosts = &quot;0.0.0.0&quot;</td><td> </td><td style="background: #eee; font-size: smaller;"> s_hosts = &quot;0.0.0.0&quot;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> for ( i = 1; i &lt;= c; i++ ) {</td><td> </td><td style="background: #eee; font-size: smaller;"> for ( i = 1; i &lt;= c; i++ ) {</td></tr> <tr><td colspan="2" align="left"><strong>Line 110:</strong></td> <td colspan="2" align="left"><strong>Line 112:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> }</td><td> </td><td style="background: #eee; font-size: smaller;"> }</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> }</td><td> </td><td style="background: #eee; font-size: smaller;"> }</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><del style="color: red; font-weight: bold; text-decoration: none;"> </del>if ( c &gt; 0 ) {</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> }</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> END {</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>if ( c &gt; 0 ) {</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> s_hosts = &quot;0.0.0.0&quot;</td><td> </td><td style="background: #eee; font-size: smaller;"> s_hosts = &quot;0.0.0.0&quot;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> for ( i = 1; i &lt;= c; i++ ) {</td><td> </td><td style="background: #eee; font-size: smaller;"> for ( i = 1; i &lt;= c; i++ ) {</td></tr> <tr><td colspan="2" align="left"><strong>Line 118:</strong></td> <td colspan="2" align="left"><strong>Line 122:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> }</td><td> </td><td style="background: #eee; font-size: smaller;"> }</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> }'</td><td> </td><td style="background: #eee; font-size: smaller;"> }'</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">}</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"># Function: wait_for_connection</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">wait_for_connection() {</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> # Wait for an Internet connection.</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> # This possibly could take a long time.</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> while :; do</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ping -c 1 -w 10 www.freebsd.org &gt; /dev/null 2&gt;&amp;1 &amp;&amp; break</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> sleep 10</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> done</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">}</td><td> </td><td style="background: #eee; font-size: smaller;">}</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"># Set lock file.</td><td> </td><td style="background: #eee; font-size: smaller;"># Set lock file.</td></tr> <tr><td colspan="2" align="left"><strong>Line 126:</strong></td> <td colspan="2" align="left"><strong>Line 139:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> [ -f &quot;\$LOCK_FILE&quot; ] &amp;&amp; exit 0</td><td> </td><td style="background: #eee; font-size: smaller;"> [ -f &quot;\$LOCK_FILE&quot; ] &amp;&amp; exit 0</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> echo \$\$ &gt; &quot;\$LOCK_FILE&quot;</td><td> </td><td style="background: #eee; font-size: smaller;"> echo \$\$ &gt; &quot;\$LOCK_FILE&quot;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> # Wait for an Internet connection.</td><td colspan="2">&nbsp;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> while :; do</td><td colspan="2">&nbsp;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> ping -c 1 -w 10 www.freebsd.org &gt; /dev/null 2&gt;&amp;1 &amp;&amp; break</td><td colspan="2">&nbsp;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> sleep 10</td><td colspan="2">&nbsp;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> done</td><td colspan="2">&nbsp;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> # Start downloading files.</td><td> </td><td style="background: #eee; font-size: smaller;"> # Start downloading files.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> HOSTS_FILE_NUMBER=1</td><td> </td><td style="background: #eee; font-size: smaller;"> HOSTS_FILE_NUMBER=1</td></tr> <tr><td colspan="2" align="left"><strong>Line 143:</strong></td> <td colspan="2" align="left"><strong>Line 151:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> REPEAT=1</td><td> </td><td style="background: #eee; font-size: smaller;"> REPEAT=1</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> while :; do</td><td> </td><td style="background: #eee; font-size: smaller;"> while :; do</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> # Wait for internet connection.</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> wait_for_connection</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> START_TIME=\`date +%s\`</td><td> </td><td style="background: #eee; font-size: smaller;"> START_TIME=\`date +%s\`</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> # Create process to download a hosts file.</td><td> </td><td style="background: #eee; font-size: smaller;"> # Create process to download a hosts file.</td></tr> </table> Gohat http://wiki.dd-wrt.com/wiki/index.php?title=Ad_blocking&diff=45553&oldid=prev Gohat: /* Ad Blocking with builds other than Micro */ 2013-10-10T13:42:16Z <p><span class="autocomment">Ad Blocking with builds other than Micro</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 13:42, 10 October 2013</td> </tr> <tr><td colspan="2" align="left"><strong>Line 110:</strong></td> <td colspan="2" align="left"><strong>Line 110:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> }</td><td> </td><td style="background: #eee; font-size: smaller;"> }</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> }</td><td> </td><td style="background: #eee; font-size: smaller;"> }</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> s_hosts = &quot;0.0.0.0&quot;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> <ins style="color: red; font-weight: bold; text-decoration: none;">if ( c &gt; 0 ) {</ins></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><del style="color: red; font-weight: bold; text-decoration: none;"> </del>for ( i = 1; i &lt;= c; i++ ) {</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>s_hosts = &quot;0.0.0.0&quot;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"><del style="color: red; font-weight: bold; text-decoration: none;"> </del>s_hosts = s_hosts = s_hosts &quot; &quot; hosts[i]</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>for ( i = 1; i &lt;= c; i++ ) {</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>s_hosts = s_hosts = s_hosts &quot; &quot; hosts[i]</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> }</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> print s_hosts</ins></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> }</td><td> </td><td style="background: #eee; font-size: smaller;"> }</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> print s_hosts</td><td colspan="2">&nbsp;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> }'</td><td> </td><td style="background: #eee; font-size: smaller;"> }'</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">}</td><td> </td><td style="background: #eee; font-size: smaller;">}</td></tr> </table> Gohat http://wiki.dd-wrt.com/wiki/index.php?title=Ad_blocking&diff=45552&oldid=prev Gohat: /* Ad Blocking with builds other than Micro */ 2013-10-10T13:28:29Z <p><span class="autocomment">Ad Blocking with builds other than Micro</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 13:28, 10 October 2013</td> </tr> <tr><td colspan="2" align="left"><strong>Line 45:</strong></td> <td colspan="2" align="left"><strong>Line 45:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"># --- COPY THE TEXT BELOW TO DD-WRT / ADMINISTRATION / COMMANDS then click SAVE FIREWALL ---</td><td> </td><td style="background: #eee; font-size: smaller;"># --- COPY THE TEXT BELOW TO DD-WRT / ADMINISTRATION / COMMANDS then click SAVE FIREWALL ---</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">BH_SCRIPT=&quot;/tmp/blocking_hosts.sh&quot;</td><td> </td><td style="background: #eee; font-size: smaller;">BH_SCRIPT=&quot;/tmp/blocking_hosts.sh&quot;</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">BH_WHITELIST=&quot;/tmp/blocking_hosts.whitelist&quot;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">logger &quot;Download blocking hosts file and restart dnsmasq ...&quot;</td><td> </td><td style="background: #eee; font-size: smaller;">logger &quot;Download blocking hosts file and restart dnsmasq ...&quot;</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"># Create whitelist.</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">cat &gt; &quot;$BH_WHITELIST&quot; &lt;&lt;EOF</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">whitelist-example\\.com</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">.*\\.whitelist-example\\.com</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">EOF</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"># Create download script.</td><td> </td><td style="background: #eee; font-size: smaller;"># Create download script.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">cat &gt; &quot;$BH_SCRIPT&quot; &lt;&lt;EOF</td><td> </td><td style="background: #eee; font-size: smaller;">cat &gt; &quot;$BH_SCRIPT&quot; &lt;&lt;EOF</td></tr> <tr><td colspan="2" align="left"><strong>Line 51:</strong></td> <td colspan="2" align="left"><strong>Line 57:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"># Function: clean_hosts_file [file ...]</td><td> </td><td style="background: #eee; font-size: smaller;"># Function: clean_hosts_file [file ...]</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">clean_hosts_file() {</td><td> </td><td style="background: #eee; font-size: smaller;">clean_hosts_file() {</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> # The sed script cleans up the file.</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> # The awk script groups the hosts by ten items.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> sed -e '/^127.0.0.1/b replace;</td><td> </td><td style="background: #eee; font-size: smaller;"> sed -e '/^127.0.0.1/b replace;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> /^0.0.0.0/b replace;</td><td> </td><td style="background: #eee; font-size: smaller;"> /^0.0.0.0/b replace;</td></tr> <tr><td colspan="2" align="left"><strong>Line 56:</strong></td> <td colspan="2" align="left"><strong>Line 64:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> d; b;</td><td> </td><td style="background: #eee; font-size: smaller;"> d; b;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> :replace;</td><td> </td><td style="background: #eee; font-size: smaller;"> :replace;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> s/^<del style="color: red; font-weight: bold; text-decoration: none;">127.</del>0.0.<del style="color: red; font-weight: bold; text-decoration: none;">1/</del>0.0.0.0/;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> s/^0.0.0.0<ins style="color: red; font-weight: bold; text-decoration: none;">[[:space:]]*//;</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> s/^127</ins>.0.0<ins style="color: red; font-weight: bold; text-decoration: none;">.1[[:space:]]*/</ins>/;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> s/[[:space:]]*#.*\$//;</td><td> </td><td style="background: #eee; font-size: smaller;"> s/[[:space:]]*#.*\$//;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> s/[[:space:]]*\$//;</td><td> </td><td style="background: #eee; font-size: smaller;"> s/[[:space:]]*\$//;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> s/[[:space:]][[:space:]]*/ /;</td><td> </td><td style="background: #eee; font-size: smaller;"> s/[[:space:]][[:space:]]*/ /;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> /^<del style="color: red; font-weight: bold; text-decoration: none;">0.0.0.0</del>[[:space:]]<del style="color: red; font-weight: bold; text-decoration: none;">localhost</del>\$/b drop;' \$*</td><td>+</td><td style="background: #cfc; font-size: smaller;"> /^<ins style="color: red; font-weight: bold; text-decoration: none;">localhost\$/b drop;</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> /^</ins>[[:space:]]<ins style="color: red; font-weight: bold; text-decoration: none;">*</ins>\$/b drop;' \$* <ins style="color: red; font-weight: bold; text-decoration: none;">| \\</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> awk 'BEGIN {</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> # Read whitelist file.</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> n_whitelist = 0</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> while ( getline &lt; &quot;$BH_WHITELIST&quot; ) {</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> if ( \$0 == &quot;&quot; ) {</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> break</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> }</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> else {</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> whitelist[++n_whitelist] = \$0</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> }</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> }</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> close(&quot;$BH_WHITELIST&quot;)</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> # Setup record sparator.</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> RS=&quot; +&quot;</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> }</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> {</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> c = 0</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> for ( n = 1; \$n != &quot;&quot;; n++ ) {</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> # Check whitelist.</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> whitelist_flag = 0</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> for ( w = 1; w &lt;= n_whitelist; w++ ) {</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> if ( \$n ~ ( &quot;^&quot; whitelist[w] &quot;\$&quot; ) ) {</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> whitelist_flag = 1</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> break</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> }</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> }</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> if ( whitelist_flag == 0 ) {</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> c += 1</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> hosts[c] = \$n</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> if ( c == 5 ) {</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> s_hosts = &quot;0.0.0.0&quot;</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> for ( i = 1; i &lt;= c; i++ ) {</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> s_hosts = s_hosts &quot; &quot; hosts[i]</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> }</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> print s_hosts</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> c = 0</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> }</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> }</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> }</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> s_hosts = &quot;0.0.0.0&quot;</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> for ( i = 1; i &lt;= c; i++ ) {</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> s_hosts = s_hosts = s_hosts &quot; &quot; hosts[i]</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> }</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> print s_hosts</ins></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> }'</ins></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">}</td><td> </td><td style="background: #eee; font-size: smaller;">}</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"># Set lock file.</td><td> </td><td style="background: #eee; font-size: smaller;"># Set lock file.</td></tr> <tr><td colspan="2" align="left"><strong>Line 139:</strong></td> <td colspan="2" align="left"><strong>Line 194:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">sh &quot;$BH_SCRIPT&quot; &amp;</td><td> </td><td style="background: #eee; font-size: smaller;">sh &quot;$BH_SCRIPT&quot; &amp;</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">&lt;/pre&gt;</td><td> </td><td style="background: #eee; font-size: smaller;">&lt;/pre&gt;</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Its possible to add hosts to a whitelist. Whitelist hosts are regular expressions. You must escape a backslash by a backslash.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">You may add other URLs to the list. You may be inspired by Ad-Away. See: [https://github.com/dschuermann/ad-away/wiki/HostsSources Ad-Away-Wiki]. Keep in mind: your routers memory limits.</td><td> </td><td style="background: #eee; font-size: smaller;">You may add other URLs to the list. You may be inspired by Ad-Away. See: [https://github.com/dschuermann/ad-away/wiki/HostsSources Ad-Away-Wiki]. Keep in mind: your routers memory limits.</td></tr> </table> Gohat