What's new

[Beta] Adblock WCHFA (Closed, use AB-Solution thread).

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Today i flashed my home AC68U with latest Rmerlin image and did a factory reset.
Manually deleted everything in my jffs folder and chnaged my USB pen from FAT to EXT4.
Downloaded 9.5.2 and installed the extended version.
Aftr a reboot of the router the scripts dont work.
My geuss is the dnsmasq.postconf is misisng the sleep command.
In the router log i see a few times it reads other hostfiles but at that time the USB disks(I have the pen and a hdd connected) arent loaded yet.
I'm going to try adding the sleep command and see how it reacts.

Edit: i cant get the manual setup from your other thread working either.
Reinstalled this beta version and after the message of adds be gone they are actually gone.
After a reboot of the router they are back though.
The sleep command doesnt work to fix the problem.
Anyhting i could do for you to debug the problem?
 
Last edited:
@miniterror there is no sleep command anywhere. What are you talking about?
 
I never said the sleep command is there.
I said i am going to try to add it to see if that fixes the problem of the script not working after a reboot of the router.

When i install the script 0.9.5.2 it ends with the message all ads are gone.
If i check it is so.
When i reboot the router all adds are back and the script isnt working anymore.
Thats why i thought to add the sleep command, maybe it isnt working anymore after a reboot because the USB drive where the files are stored isnt loaded yet.
 
I see. Look at the syslog for errors like file not found or something like this.
Do this before you add a sleep. Post what you find in the log.
This might be relevant for the next beta version.
 
you may want to add a limit on the while loop.....postconf is a blocking script, so if the resource never comes available you'll hang the boot.
 
you may want to add a limit on the while loop.....postconf is a blocking script, so if the resource never comes available you'll hang the boot.
Which is exactly what just happened to me!
I am going to remove that entry.
Thanks John
 
When i look at the log after a reboot i see this.
custom script: Running /jffs/scripts/dnsmasq.postconf (args: /etc/dnsmasq.conf)

When i manually execute the file from SSH i get the message.
/jffs/scripts/dnsmasq.postconf: line 15: can't create : nonexistent directory

Looking at the file with notepad++ i see that line 15 is the txt FI.
Nothing else, see screenshot.

Edit: i just tried 0.9.4 and it gives me the same result.
I am 100% positive 0.9.4 worked correctly when i used Johns Fork.
Now that im running Rmerlin his latest version it isnt working anymore.
Could it be Rmerlin doesnt support it?
 

Attachments

  • Asus.PNG
    Asus.PNG
    93.7 KB · Views: 608
Last edited:
When i look at the log after a reboot i see this.
custom script: Running /jffs/scripts/dnsmasq.postconf (args: /etc/dnsmasq.conf)

When i manually execute the file from SSH i get the message.
/jffs/scripts/dnsmasq.postconf: line 15: can't create : nonexistent directory

Looking at the file with notepad++ i see that line 15 is the txt FI.
Nothing else, see screenshot.

Edit: i just tried 0.9.4 and it gives me the same result.
I am 100% positive 0.9.4 worked correctly when i used Johns Fork.
Now that im running Rmerlin his latest version it isnt working anymore.
Could it be Rmerlin doesnt support it?
Try to remove Fi in dnsmasq.postconf and test again.
 
When i look at the log after a reboot i see this.
custom script: Running /jffs/scripts/dnsmasq.postconf (args: /etc/dnsmasq.conf)

When i manually execute the file from SSH i get the message.
/jffs/scripts/dnsmasq.postconf: line 15: can't create : nonexistent directory
Don't run dnsmasq.postconf manually.
It's better to run service restart_dnsmasq in a terminal to rerun that file.

And if you run service restart_dnsmasq when the adblocking is not workingdoes does it work afterwards?

Edit: i just tried 0.9.4 and it gives me the same result.
I am 100% positive 0.9.4 worked correctly when i used Johns Fork.
Now that im running Rmerlin his latest version it isnt working anymore.
Could it be Rmerlin doesnt support it?
All beta releases run just fine with all the USB Sticks I have (about 8) and also on both routers with the latest Asuswrt-Merlin FW.

The fact that it appears to be working just after the setup tells me your router has a problem with mounting your USB device(s) when rebooting.
You could add this at the end of the services-start file:
Code:
sleep 10
service restart_dnsmasq
Then reboot the router again and hopefully it works then.
 
Refreshed the Systemlog and then enterd the ASUS with SSH.
After inputting the "service restart_dnsmasq" i refreshed the system log and i got this.
Code:
Jan 31 09:56:09 dropbear[5787]: Child connection from 192.168.1.11:64612
Jan 31 09:56:14 dropbear[5787]: Password auth succeeded for 'admin' from 192.168.1.11:64612
Jan 31 09:56:33 rc_service: service 5831:notify_rc restart_dnsmasq
Jan 31 09:56:34 custom script: Running /jffs/scripts/dnsmasq.postconf (args: /etc/dnsmasq.conf)

Adds are stille there

Edit: After a flushdns they are gone.
Still dont get why it gives a arg at the end of the script though.
 
Last edited:
I don't think this is a good idea...
okey see now, i had to make a bigger picture to see.
/jffs/scripts/dnsmasq.postconf: line 15: can't create : nonexistent directory
 
Edit: After a flushdns they are gone.
So, sleep seems to work for you. I'll add some code to prevent that in the next beta release.
Still dont get why it gives a arg at the end of the script though.
Don't know why either, produces the same error when I run it.
As mentioned above, run service restart_dnsmasq in a terminal. It does the same thing in a healthy way for the router...
 
Still dont get why it gives a arg at the end of the script though
postconf scripts are always passed the name of the conf file to modify as an argument (when called by the router code). If you run a postconf script manually, you need to provide that argument yourself.
 
Not looked in detail at scripts - but you shouldn't add direct links to files usb drive to the dnsmasq conf. dnsmasq is required to run early in router boot to provide lan dhcp services, it is restarted later once wan is up. When it runs first only jffs is available, I don't like the idea you sleep or wait for usb. dnsmasq coughs when conf files are not found, but doesn't mind if conf file directories are empty so in my minimal adblock+pixelserv setup my dnsmasq.conf refers to a ram disk folder created by dnsmasq.postconf
Code:
admin@RT-N66U:/tmp/home/root# cat /jffs/scripts/dnsmasq.postconf
#!/bin/sh
mkdir -p /etc/dnsmasq.d

Then dnsmasq.conf looks in there

Code:
conf-dir=/etc/dnsmasq.d

Then my post-mount script links itself into that folder, and restarts dnsmasq with adblock active

Code:
admin@RT-N66U:/tmp/home/root# cat /jffs/scripts/post-mount
#!/bin/sh

logger "partition $1 mounted"

if [ "$1" = "/tmp/mnt/usb4gb" ]; then
  ln -sf $1/adblock.conf /etc/dnsmasq.d/
fi
service restart_dnsmasq

My intention is that the router will work if usb doesn't start, just won't have adblocking. Hope these ideas are useful
 
Last edited:
Question:
We often go to cbs.com to watch one of their network shows. Since installing the adblock script we can't watch the shows. It says something like, "The show is not available since you will not allow our Ad/commercials to run. Please uninstall any Ad blocker software you may have running." Great, this proves your script is working just fine. Now how would I proceed to identify and to add whatever the cbs site is looking for into the whitelist.txt file? Is it as simple as adding cbs.com.

PS. It is not that simple. I tried it.
 
Last edited:
Question:
We often go to cbs.com to watch one of their network shows. Since installing the adblock script we can't watch the shows. It says something like, "The show is not available since you will not allow our Ad/commercials to run. Please uninstall any Ad blocker software you may have running." Great, this proves your script is working just fine. Now how would I proceed to identify and to add whatever the cbs site is looking for into the whitelist.txt file? Is it as simple as adding cbs.com.

PS. It is not that simple. I tried it.
Try these:
dw.cbsi.com
native.sharethrough.com
adserver.adtechus.com

You'll need to rerun the update-hosts.sh in a terminal to make them active. Depending on your path to the file this would be something like:
sh /tmp/mnt/sda1/adblocking/update-hosts.sh
 
I tried your suggestions but it didn't work. I even tried a program called urlSnooper2 to see if I could find other urls to add. No luck yet.
 
I tried your suggestions but it didn't work. I even tried a program called urlSnooper2 to see if I could find other urls to add. No luck yet.
I tried your suggestions but it didn't work. I even tried a program called urlSnooper2 to see if I could find other urls to add. No luck yet.

livepassdl.conviva.com
cbsi.com
secure-us.imrworldwide.com
livepass.conviva.com

those above ,tested working, Add them to the white list and rerun update-hosts.sh

In my experience for some reason when you add a domain with double full stops like dw.cbsi.com to the whitelist the whitelist filter no longer works.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top