Ad-blocking with DD-WRT

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3, ... 17, 18, 19  Next
Author Message
cyberde
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1488
Location: the Netherlands

PostPosted: Thu Sep 20, 2007 15:52    Post subject: Reply with quote
Adding the folowing to your wanup-script should be enough:
Code:
wget -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:]]*#.*$//' > /etc/hosts

_________________
Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N

Donater
Sponsor
cheebs
DD-WRT Novice


Joined: 19 Apr 2007
Posts: 14
Location: Kent UK

PostPosted: Thu Sep 20, 2007 15:57    Post subject: Reply with quote
Thanks for the fast response

How do i go about adding that to that script? I have never used scripts for anything, let alone editing them.

Thanks in advance

Chris
cyberde
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1488
Location: the Netherlands

PostPosted: Thu Sep 20, 2007 16:02    Post subject: Reply with quote
redhawk0 wrote:
Yeah...this does work...but there ain't no way it will work on a neutered V5-6 Linksys.

I am running it on a 16M Linksys V2 and I only have 750K left now.

redhawk

Code:
Total Available   86%   14084 kB / 16384 kB
Seems to be enough, using a Linksys WRT54GSv4

cheebs wrote:
Thanks for the fast response

How do i go about adding that to that script? I have never used scripts for anything, let alone editing them.

Goto Administration -> Commands, then paste the script into the field and hit Save Firewall. That's about it Smile

_________________
Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N

Donater
HowardZ
DD-WRT Guru


Joined: 18 Jun 2007
Posts: 706
Location: Maryland

PostPosted: Fri Sep 21, 2007 3:00    Post subject: Reply with quote
When I run that script, the host file has a ^M at the end of each line.
infusion
DD-WRT Guru


Joined: 30 Aug 2006
Posts: 506

PostPosted: Fri Sep 21, 2007 3:07    Post subject: Reply with quote
I don't get any error, but I can't get it to work either....
speedy3k
DD-WRT User


Joined: 19 Apr 2007
Posts: 180

PostPosted: Fri Sep 21, 2007 3:09    Post subject: Reply with quote
try the script that I posted. it works like a charm. I use it in as a startup script. after I save..i rebooted the router. all is good.
infusion
DD-WRT Guru


Joined: 30 Aug 2006
Posts: 506

PostPosted: Fri Sep 21, 2007 3:17    Post subject: Reply with quote
speedy3k wrote:
this was ripped from a tomato forum and all credits go to mraneri at linksysinfo.org
not sure if it will work with dd-wrt but might be worth taking a look.


Like a charm in tomato or you have it running with ddwrt?
speedy3k
DD-WRT User


Joined: 19 Apr 2007
Posts: 180

PostPosted: Fri Sep 21, 2007 3:21    Post subject: Reply with quote
im running it in dd-wrt.
HowardZ
DD-WRT Guru


Joined: 18 Jun 2007
Posts: 706
Location: Maryland

PostPosted: Fri Sep 21, 2007 3:33    Post subject: Reply with quote
If you

vi hosts

you will see carriage returns ^M at the end of most of the lines.
This is undesirable.
In Unix lines should end with a linefeed, not a carriage-return and linefeed.

Though I believe you that the script works - despite the flawed hosts file.
infusion
DD-WRT Guru


Joined: 30 Aug 2006
Posts: 506

PostPosted: Fri Sep 21, 2007 3:33    Post subject: Reply with quote
And I think it doesn't work in ddwrt. Thanks anyway.
HowardZ
DD-WRT Guru


Joined: 18 Jun 2007
Posts: 706
Location: Maryland

PostPosted: Fri Sep 21, 2007 3:34    Post subject: Reply with quote
infusion wrote:
I don't get any error, but I can't get it to work either....


When I typed it in - exactly as shown, it wouldn't work.

I had to cut and paste to get it to work.
Though those carriage returns should be removed from the host file.

I must have missed something.
speedy3k
DD-WRT User


Joined: 19 Apr 2007
Posts: 180

PostPosted: Fri Sep 21, 2007 3:46    Post subject: Reply with quote
I see what you are talking about. its probably because the original txt files has them.
infusion
DD-WRT Guru


Joined: 30 Aug 2006
Posts: 506

PostPosted: Fri Sep 21, 2007 4:06    Post subject: Reply with quote
HowardZ wrote:
I had to cut and paste to get it to work.


Does it mean that you just didn't get any error or you got it working? Very Happy
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11563
Location: Wherever the wind blows- North America

PostPosted: Fri Sep 21, 2007 11:14    Post subject: Reply with quote
HowardZ....use the dos2unix command.....it will remove all the ^M characters at the end of the lines.

This is done in unix of course.

redhawk

_________________
The only stupid question....is the unasked one.
HowardZ
DD-WRT Guru


Joined: 18 Jun 2007
Posts: 706
Location: Maryland

PostPosted: Fri Sep 21, 2007 12:47    Post subject: Reply with quote
infusion wrote:
HowardZ wrote:
I had to cut and paste to get it to work.


Does it mean that you just didn't get any error or you got it working? Very Happy


I typed it in exactly, got error when running the script.
Checked over and over and over that every character was correct - same problem.
Then I cut and pasted the script, and it runs without any error message.

I think it is working - despite the carriage returns at the end of most lines in the host file.
I think it is working because if I go to a website and click on an add with "doubleclick" in its url- it results in an error and can't load the web page.
Goto page Previous  1, 2, 3, ... 17, 18, 19  Next Display posts from previous:    Page 2 of 19
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum