Posted: Sat Sep 12, 2020 18:25 Post subject: Ad blocking
I'm using the 64 2gb full version on a dell vostro. I've tried every script for ad blocking and none of them will work. I did use one on an archer c7 that worked great. I'm also using openvpn with policy based routing, but that worked with ad blocking on the c7. I'm using build 43886. Also the local dns option is not available.
All my scripts assume the availability of jffs. It just simplifies installation. But in most cases, you can just save it to the startup script (Administration->Commands). But sometimes the script, as is, is too large, and you may have to delete the comments. You'll have to modify the cronjob as well.
Code:
4 * * * root /tmp/.rc_startup
The other options is to save the script to the custom script, then call the custom script from the startup script.
Sounds like the script isn't even running, or is but producing some error. Because the file referenced by DNSMasq is created by my script.
Now you see why I have an installer. All it takes is a slight mistake in the setup, and things go wrong.
All I can recommend is making sure the DEBUG line at the top of the script is enabled, making sure the syslog is enabled, rebooting, and checking the syslog for any messages from the script (w/ the DEBUG option enabled, there should be plenty of such messages).
From a shell (ssh/telnet)...
Code:
cat /var/log/messages | grep 'rc_startup'
or
Code:
cat /var/log/messages | grep 'custom'
... depending on whether you used the startup or custom script to run my script.
As a sanity check, I decided to install the script as described in the documentation to jffs. I'm even using a dd-wrt x86 build. It works fine. So the script itself is fine.
However, I noticed an issue if I saved it to the custom script. Apparently something changed in dd-wrt, and the custom script is no longer saved to /tmp/custom.sh (as it says in the dd-wrt wiki, https://wiki.dd-wrt.com/wiki/index.php/Startup_Scripts#Custom_Scripts), but instead /tmp/.rc_custom! So if you're using the custom script method, the startup script needs to have the following.
Code:
/tmp/.rc_custom
And if I now grep for the custom script …
Code:
cat /var/log/messages | grep 'custom'
… I see the output. One of the last lines says 'total blacklisted domains: 18662'.
Why and when this was changed, I don't know. But I rarely ever use the custom script, and last time I did, it was /tmp/custom.sh. Somewhere along the dd-wrt timeline this changed.
P.S. If you copy/paste from PasteBin, make sure you copy from the RAW Paste Data section.
Another common error is to download to Notepad, make changes, then upload to the router, which leaves DOS CR/LFs in the output, which Linux can't read.
Through ssh I see no errors and since reboot the syslog has no errors. I also used wget instead of curl if that makes a difference. Seems to be working now, thank you very much for the help.