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!

I did crontab -e to edit it to do the update at midnight each days:

0 0 * * * /tmp/mnt/sda1/adblocking/update-hosts.sh #UpdateHosts#
 
I did crontab -e to edit it to do the update at midnight each days:

0 0 * * * /tmp/mnt/sda1/adblocking/update-hosts.sh #UpdateHosts#
That is overkill. Most of the hosts files update infrequently, about once a month.
Pulling them every night is a waste of your routers and the hosts file providers resources.

Also, the crontab gets written at boot by the /jffs/scripts/services-start file, where the setup-script added the line.
Your manual overwrite will be lost at the next reboot.
 
Ohhh I see, thanks for your input, also, it looks like it's working on my RT-AC3200, I can't tell you since I don't find any site to test the configuration.
 
0.9.5.2_beta is out for testing!

This is a Hotfix.
Existing services-start file with existing UpdateHosts cron job would be overwritten by wrong values.
This bug has unlikely affected anyone using a previous version.
 
0.9.5.2_beta is out for testing!

This is a Hotfix.
Existing services-start file with existing UpdateHosts cron job would be overwritten by wrong values.
This bug has unlikely affected anyone using a previous version.

0.9.5.2_beta is installed, but I see still ads on my pc/android/ios device. Router is AC87U with the latest 380.57.2_HGG-FINAL firmware. I have 2 hdds, all is re-created with fdisk and formatted as ext4 directly from router.
For example site I use snbforum, xda and speedtest, and I still see ads on all websites. The dnsmasq show me all of the ads will be blocked but despite I see this ads. On windows dns cache is cleared with ipconfig /flushdns, chrome cache cleared, ie explorer cache is cleared. For WAN DNS I use Google DNS. Under LAN > DHCP "Advertise router's IP in addition to user-specified DNS" is set to yes, if I set to no, then ads are still visible. Any idea? What should I check or change? If somebody can help me, I can share my desktop via TeamViewer.
 
I see you said it uses: "And it uses jffs/scripts/dnsmasq.postconf instead of /jffs/configs/dnsmasq.conf.add. Apart from that it's really nothing new (yet)."

If we are already running the Advanced blocker will this remove the old files, ie dnsmasq.conf.add and replace it with the updated dnsmasq.postconf?

Lastly there is nothing changed since the manual way, but you say there will be in the future, could you share?
Just wondering if I switch to this now or later...
 
@all, @Savell Martin & @ColinTaylor
I think it's time to reveal where this script is going and what features you can expect as it evolves.

The beta versions will be the ground for more features that the 1.0 and subsequent releases will build on.

The 0.9.5.2_beta features so far:
- Automatic install of the manual "Adblocking with combined hosts file (Advanced)" (duh)
- The script can be rerun at any time to enable or disable features, a backup of previous installs is placed in the adb-backup directory in dated folders
- Choice of two combined hosts files: Standard or Extended (extended being the Advanced manual method)
- Dnsmasq logging on or off, with log rotation once a week (the version of dnsmasq used by Asus does not support a max file size)
- Select on which supported device you want to install if you have several plugged in
- Updates the combined hosts file once a week on the same weekday you install the script (cron job)
- An existing services-start file will be appended and not overwritten with the required entry for cron
- Tries to detect a manual install of "Adblocking with combined hosts file" and prompt for manual deletion of it before you rerun the script
(this is not fail-save atm as I have no idea how and where the files were placed. If you used the paths suggested in the tutorial it will detect it)
- Writes a dated backup of the services-start and dnsmasq.postconf file in the adb-backup directory
- Creates a blacklist and a whitelist. The whitelist has some default entires in it to (try) to support SmallNetBuilder.com and snbforums.com
- Writes an install log to adblocking/logs

Then there are some initial Checks and tests done before the setup script can run:
- Checks and sets to "Yes" the "Custom scripts in /jffs/".
- Checks if a /jffs/ format is scheduled at next reboot
- Checks if /jffs/ is actually present
- Checks and sets "Forward local domain queries to upstream DNS" to "No"
Some of these need a reboot before the setup script can run. It will prompt to do so.

Future beta features, in no particular order:
- Unistall AdBlocking (the manual and the automated version)
- Enable and disable dnsmasq logging
- Enable and disable the AdBlocking without uninstalling (for those days when you need to see the ads, or go to a blocked site or for whatever reason, I am not judging you...)
- Final check if the install process has installed all files and AdBlocking is working (from the router's viewpoint)

Not sure if in beta or 1.0 release:
- In place update of the adblock-setup.sh file to latest version
- Create a settings file

Starting in the 1.0 release I expect to implement these features, also in no particular order:
- Basic AdBlocking statistics, viewed in a terminal
- Some sort of pixelserv, Ads are replaced by an empty gif file
- Pretty Statistics (yes that means a GUI! And I have it running on my main router already)
- A settings page (GUI)
- Select your own hosts file combination (GUI)
- Rename "AdBlock wchfa" to something better (suggestions welcome...)
- Not sure yet what more I will add

So, to finally answer @ColinTaylor's question:
> Hi LC. Is there any reason why FAT filesystems aren't supported, only ext2/3/4?
The future features of this script require an ext* formatted device. That is why I disabled it in the first beta release. It would run perfectly OK on a FAT formatted device but I want to make sure all installs (including the beta versions) are upgrade proof for the future.

And @Savell Martin: I think this answered your question.

A final word: It is safe to use the beta version now.
I have designed it to be compatible with future updates and features.
 
Last edited:
I do not know why this script not working for me....i placed script to tmp/mnt/sda1 and got no permission error....

sent from Kodi 17 Krypton
 
@all, @Savell Martin & @ColinTaylor
I think it's time to reveal where this script is going and what features you can expect as it evolves.

The beta versions will be the ground for more features that the 1.0 and subsequent releases will build on.

The 0.9.5.2_beta features so far:
- Automatic install of the manual "Adblocking with combined hosts file (Advanced)" (duh)
- The script can be rerun at any time to enable or disable features, a backup of previous installs is placed in the adb-backup directory in dated folders
- Choice of two combined hosts files: Standard or Extended (extended being the Advanced manual method)
- Dnsmasq logging on or off, with log rotation once a week (the version of dnsmasq used by Asus does not support a max file size)
- Select on which supported device you want to install if you have several plugged in
- Updates the combined hosts file once a week on the same weekday you install the script (cron job)
- An existing services-start file will be appended and not overwritten with the required entry for cron
- Tries to detect a manual install of "Adblocking with combined hosts file (Advanced)" and prompt for manual deletion of it before you rerun the script
(this is not fail-save atm as I have no idea how and where the files were placed. If you used the paths suggested in the tutorial it will detect it)
- Writes a dated backup of the services-start and dnsmasq.postconf file in the adb-backup directory
- Creates a blacklist and a whitelist. The whitelist has some default entires in it to (try) to support SmallNetBuilder.com and snbforums.com
- Writes an install log to adblocking/logs

Then there are some initial Checks and tests done before the setup script can run:
- Checks and sets to "Yes" the "Custom scripts in /jffs/".
- Checks if a /jffs/ format is scheduled at next reboot
- Checks if /jffs/ is actually present
- Checks and sets "Forward local domain queries to upstream DNS" to "No"
Some of these need a reboot before the setup script can run. It will prompt to do so.

Future beta features, in no particular order:
- Unistall AdBlocking (the manual and the automated version)
- Enable and disable dnsmasq logging
- Enable and disable the AdBlocking without uninstalling (for those days when you need to see the ads, or go to a blocked site or for whatever reason, I am not judging you...)
- Final check if the install process has installed all files and AdBlocking is working (from the router's viewpoint)

Not sure if in beta or 1.0 release:
- In place update of the adblock-setup.sh file to latest version
- Create a settings file

Starting in the 1.0 release I expect to implement these features, also in no particular order:
- Basic AdBlocking statistics, viewed in a terminal
- Some sort of pixelserv, Ads are replaced by an empty gif file
- Pretty Statistics (yes that means a GUI! And I have it running on my main router already)
- A settings page (GUI)
- Select your own hosts file combination (GUI)
- Rename "AdBlock wchfa" to something better (suggestions welcome...)
- Not sure yet what more I will add

So, to finally answer @ColinTaylor's question:
> Hi LC. Is there any reason why FAT filesystems aren't supported, only ext2/3/4?
The future features of this script require an ext* formatted device. That is why I disabled it in the first beta release. It would run perfectly OK on a FAT formatted device but I want to make sure all installs (including the beta versions) are upgrade proof for the future.

And @Savell Martin: I think this answered your question.

A final word: It is safe to use the beta version now.
I have designed it to be compatible with future updates and features.

"Checks and sets "Forward local domain queries to upstream DNS" to "No"" by me was it always enabled, and the script is success installed without any "error" message, for Example : the script install can not done, because Checks and sets "Forward local domain queries to upstream DNS is on yes.....
 
"Checks and sets "Forward local domain queries to upstream DNS" to "No"" by me was it always enabled, and the script is success installed without any "error" message, for Example : the script install can not done, because Checks and sets "Forward local domain queries to upstream DNS is on yes.....
If I understand correctly you have "Forward local domain queries to upstream DNS" set to yes and it installed anyway without errors?
Try to reboot and check that setting again in the router GUI.
Also, which beta version were you using (line 15, script_version in the script)?
And what router / firmware?
 
I do not know why this script not working for me....i placed script to tmp/mnt/sda1 and got no permission error....

sent from Kodi 17 Krypton
Then try running this in a terminal if adblock-setup.sh is placed in the root of sda1:
Code:
sh /tmp/mnt/sda1/adblock-setup.sh
 
Hi, is there a way to uninstall it? I really want to try it but as i watch football streams, i am not sure what to expect?

Nonetheless, great job!
 
Then try running this in a terminal if adblock-setup.sh is placed in the root of sda1:
Code:
sh /tmp/mnt/sda1/adblock-setup.sh
Yes, i try that but no luck over SCP and ssh 22 port....

sent from Kodi 17 Krypton
 
Hi, is there a way to uninstall it? I really want to try it but as i watch football streams, i am not sure what to expect?
An automatic uninstall is planned in one of the next beta releases.
For the time being (and if you had no other scripts installed on your router before running my setup script):
Remove the following files:
/jffs/scripts/services-start
/jffs/scripts/dnsmasq.postconf
And then reboot your router. This will effectively disable AdBlocking.
Then you can also remove the adblocking and adb-backup (may not exist) folders on your USB device.
 
If I understand correctly you have "Forward local domain queries to upstream DNS" set to yes and it installed anyway without errors?
Try to reboot and check that setting again in the router GUI.
Also, which beta version were you using (line 15, script_version in the script)?
And what router / firmware?
Yes, it has installed anyway without error.
Router is AC87U with the latest 380.57.2_HGG-FINAL firmware with optware-ng . After the reboot is the same... I have placed the script in the /home/root directory, after the install I have removed the script.
 
Last edited:

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