well there are variety of ADblocking scripts
but the cron job to update host files is all the same
0 12 * * * root /tmp/.rc_startup
The way this one works is a bit different. Here are the instructions (I'm also attaching the script):
Quote:
## gen_hosts by IronManLok
##
## Downloads domain entries of known ad abusers from multiple sources,
## cleans up, merges and removes duplicates. Includes white-listing and
## custom host entries.
##
## This script is intended to be used on units running DD-WRT, it requires
## the use of JFFS (or USB drive mounted on /jffs) and DNSMasq as DNS server.
##
## On Services Tab, at Additional DNSMasq options, add this line:
## addn-hosts=/tmp/gen_host.txt
##
## Call this script from your firewall script. Also, use cron to schedule its
## execution. For running everyday at 22:00:
## 0 22 * * * root /jffs/gen_host
##
## For white-listing, create /jffs/whitelist_hosts.txt and list one domain
## per line. For custom hosts entries, create /jffs/my_hosts.txt and
## add any lines in the same format of a regular hosts file.
I got it to work. It seems that cron doesn't like the sh extension on scripts.
I also made sure that it had executable permissions. chmod +x /jffs/gen_host
Thank you, thank you, thank you. Removing the .sh from the file name fixed my cron issues too. I never would have thought to try that. I have been banging my head against the wall and looking at the forums for awhile now. Glad I found your post!
Joined: 08 May 2018 Posts: 14219 Location: Texas, USA
Posted: Thu Dec 09, 2021 17:32 Post subject:
Nice necro. Anyway, the only targets that bash compatibility is not enabled on is micro. All other targets have bash compatibility configured in busybox in DD-WRT. _________________ "Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT Pogo - A minimal level of ability is expected and needed... DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)
----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Posted: Tue Jan 18, 2022 2:06 Post subject: Re: For a Buffalo Buffalo WZR-HP-G300 running v3.0 (build 44
feichter wrote:
* * * * * root /bin/sh /jffs/www/send.sh
^ This ^ works for me. Thanks. So so many attempts.
Q: Why is it so difficult?!!? A: IMHO: Very few log details. Frustrating _________________ Current: Netgear R9000 DD-WRT v3.0-r55460 std (03/25/24)
Retired: Linksys WRT32X r39296, TP-Link Archer C7 v2, LinkSys WRT54G v5
Also ... I can not execute the script (cmd, ./cmd, /xxx/cmd). Must be preceded by sh.
Hmmm.. wonder if my remote ssh connection (using Juice) is to blame. I'm going to try with telnet.
FWIW, look at the script ddwrt-blacklist-domains.sh in my signature. Notice the shebang at the top. And the instruction #6 on how to add it to the scheduler. I have hundreds of users doing this every day. I'm running it myself right now, on the scheduler.
Something has to be wrong with your script, esp. if you can't even execute it from the command line.