How to use adblock.sh
How to use adblock.sh
I want to block a website and in the absence of any parental controls I thought I could do it with adblock.sh
I read through the docs and entered adblock.sh after telneting into the router. I am running 2.93, btw.
The syntax help is confusing me. What exactly to I need to enter if I want to block a site without letting on to the user that I have blocked it? Ideally I would like to redirect the site to another innocuous site.
My old Thomson modem had parental control built in and it was so easy to enter the site I wanted to redirect and the site I wanted to redirect to.
Many thanks.
I read through the docs and entered adblock.sh after telneting into the router. I am running 2.93, btw.
The syntax help is confusing me. What exactly to I need to enter if I want to block a site without letting on to the user that I have blocked it? Ideally I would like to redirect the site to another innocuous site.
My old Thomson modem had parental control built in and it was so easy to enter the site I wanted to redirect and the site I wanted to redirect to.
Many thanks.
Re: How to use adblock.sh
I ran adblock.sh small and apparently a small dnsmasq.conf file is downloaded to the router. I assumed I could edit that file and add the url i wanted to redirect. Unfortunately I can't find it. If I edit /etc/dnsmasq.conf I can't see any of the lines I see if I download the file manually from pgl.yoyo.org
Re: How to use adblock.sh
did you look in /var/tmp/dns.d/ ?
Re: How to use adblock.sh
There is only one file in /var/tmp/dns.d - extra servers.conf - and only contains a few lines, none of which have anything to do with the dmasq.con downloaded from pgl.yoyo.org.
- thechief
- RouterTech Team
- Posts: 12067
- Joined: Wed Feb 01, 2006 10:22 pm
- Location: England, the Centre of Africa
- Contact:
Re: How to use adblock.sh
You obviously haven't run adblock.sh correctly (or adblock_multi.sh). In any case, what you want is easily done - e.g.,scgf wrote:There is only one file in /var/tmp/dns.d - extra servers.conf - and only contains a few lines, none of which have anything to do with the dmasq.con downloaded from pgl.yoyo.org.
Code: Select all
echo "address=/badsite.com/66.102.9.106" >> /var/tmp/dns.d/bad1.conf
killall dproxy
The Chief: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
No support via PM. Ask all questions on the open forum.
Re: How to use adblock.sh
I ran "adblock.sh small" again and now there is an adblock.sh.conf file in /var/tmp/dns.d/
I did what you suggested and it seems to make no difference - I can still access the site. I edited adblock.sh.conf to add the site, but again, no difference.
Does it matter that I use the the extra_dns environment variable?
I did what you suggested and it seems to make no difference - I can still access the site. I edited adblock.sh.conf to add the site, but again, no difference.
Does it matter that I use the the extra_dns environment variable?
Re: How to use adblock.sh
Do I need to add anything to make the router do the adblocking?
Re: How to use adblock.sh
I have just rebooted the router, and in spite of doing 'Save All' the adblock.sh.conf file has disappeared. Do I have to set it up every time the router reboots?
Re: How to use adblock.sh
It took a few attempts but I have it working now.
All I need to do now is make it stick between reboots!
Thanks for your help.
All I need to do now is make it stick between reboots!
Thanks for your help.
- thechief
- RouterTech Team
- Posts: 12067
- Joined: Wed Feb 01, 2006 10:22 pm
- Location: England, the Centre of Africa
- Contact:
Re: How to use adblock.sh
Search the docs for "autoexec", "RT_init" and "RT_cmd".
The Chief: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
No support via PM. Ask all questions on the open forum.
Re: How to use adblock.sh
Do I get the router to execute 'adblock.sh small' each time it boots up? Then the commands to add my website redirection?
Cheers.
Cheers.
Re: How to use adblock.sh
Since 'adblock.sh small' requires an internet connection to download the adblock.conf file, will a connection be active when the command is executed in RC_cmd? If not, won't it just fail and not try again when a connection has been established? Is there a way to ensure an internet connection is available before issuing the command?
- thechief
- RouterTech Team
- Posts: 12067
- Joined: Wed Feb 01, 2006 10:22 pm
- Location: England, the Centre of Africa
- Contact:
Re: How to use adblock.sh
The example I gave does not require adblock to be run at all. The secret is the conf file that is created in /var/tmp/dns.d/, and then killing dproxy (which will restart automatically, loading the new conf file).
The Chief: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
No support via PM. Ask all questions on the open forum.
Re: How to use adblock.sh
Is this a riddle? Why a secret? All I need to know is what to do to keep the adblock.conf file over a reboot.
I am a teacher and am exasperated with the way hackers and Linux gurus hide their knowledge behind riddles and 'read this' and 'read that'. I have run a Linux box for some years and have learned a lot but sometimes it is just too difficult. When my students at school ask for help I give the help which is suitable for that individual - I don't respond with a riddle.
Why is it so difficult to just tell me what to do?
Please search my username 'scgf' and you will see how much help I have given to the Linux, OS/2 and Mac communities over a few years. I never respond with a riddle.
Sorry to rant when you are just trying to help. I do appreciate your efforts, really!
I am a teacher and am exasperated with the way hackers and Linux gurus hide their knowledge behind riddles and 'read this' and 'read that'. I have run a Linux box for some years and have learned a lot but sometimes it is just too difficult. When my students at school ask for help I give the help which is suitable for that individual - I don't respond with a riddle.
Why is it so difficult to just tell me what to do?
Please search my username 'scgf' and you will see how much help I have given to the Linux, OS/2 and Mac communities over a few years. I never respond with a riddle.
Sorry to rant when you are just trying to help. I do appreciate your efforts, really!
Re: How to use adblock.sh
the adblock.sh.conf is stored on the ram disk, it needs to be recreated if you reboot the router. There is a special env var to automate this on every boot - it runs adblock.sh only after the WAN is connected
If you have your own webserver on lan or wan you could auto download your custom version on every boot or on first wan connection (autoexec,sh).
You could store the conf file on a minix nvram partition..
Too many ways, all a bit fiddly...
To make custom additions you need to use the RT_cmd_x variables as above, dnsmasq (pretending to be dproxy in this firmware) will honour any conf files it finds in /dns.d/ when it is started.# e.g., setenv adblock "small medium large"
If you have your own webserver on lan or wan you could auto download your custom version on every boot or on first wan connection (autoexec,sh).
You could store the conf file on a minix nvram partition..
Too many ways, all a bit fiddly...