Posted: Sun Aug 23, 2020 11:37 Post subject: ad blocking script help
for ad blocking I'm using an old script.
The script worked until version 43516, since then it stopped working.
I identified a change in the command wait but not sure what
the problematic area is
Code:
# Each file should be downloaded within 120 seconds
TEMP_FILE="/tmp/gen_host`echo $COUNT`.tmp"
($CURL -s $URL -o $TEMP_FILE) & DOWNLOAD_PID=$!
(sleep 120 && kill -TERM $DOWNLOAD_PID) & WAITER_PID=$!
I see that the line wait $DOWNLOAD_PID doesn't process correctly, it suppose wait for the curl to download the file which it does but I do not get the exist code correctly and it waits 120 sec, when it tried to kill the process it errors out, processes already finished.
Anyone can help? _________________ Netgear R9000 main router
RAX80 as AP
If you insist on "rolling your own" anyway, you might want to consider the one in my signature (ddwrt-blacklist-domains.sh). At least it's modern and up to date.
Thanks for your script, I looked inside, similar in the idea of the one I'm using, there are some differences, one of them is if a web site is not responding your script gets stuck and doesn't proceed, that's the reason there is a wait in the one I'm using. _________________ Netgear R9000 main router
RAX80 as AP
You make a good point. Something I didn't think about at the time. I'm going to update the script and add that option. Easy enough to change.
UPDATE: Done.
thanks, good base for me, I will add some support for external whitelist for and external blacklist file. _________________ Netgear R9000 main router
RAX80 as AP