What's new

AB-Solution 1.06 is out!

  • 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!

thelonelycoder

Part of the Furniture
AB-Solution is now Diversion
Please check the Diversion website for latest version and discussion link.

Welcome to AB-Solution Ad-blocking and Dnsmasq logging!


Please check the AB-Solution website for latest version and discussion link.

The important part:

- Have Asuswrt-Merlin firmware installed on a supported router

Then:

1. Installing with wget curl:
Log into your router with an ssh client and enter:
Code:
curl -O https://raw.githubusercontent.com/decoderman/AB-Solution/master/ab-solution.sh
(that's an upper case -o)

Then start the install / upgrade with:
Code:
sh ab-solution.sh
Make sure you have a USB Stick with ext2, ext3 or ext4 formatted filesystem plugged in your router.
It needs to be permanently plugged in if you install AB-Solution.

2. Installing from a USB device:
You can also download the latest version from GitHub and place the file ab-solution.sh onto an ext2, ext3 or ext4 formatted USB Stick.
Then plug it into the router, open an ssh terminal and start the install with
Code:
sh /tmp/mnt/sda1/ab-solution.sh
Where /sda1/ is your device's name. Change this if yours differs.
Within a few minutes the installation is finished and ads are blocked.

See also v1.05 and v1.0 threads for more info about AB-Solution.

Release notes v1.06:
Bugfixes from Version 1.05:
- Minor coding fixes
- Copy script file to adblocking-device now works during install / update

New in this version:
- Uninstall AB-Solution (yes, it's possible now)
- Sort hosts file alphabetically (helps to find similar entries when white- or blacklisting)

Screenshot of the current version:

HDK8i18.png
 
Last edited:
Hi Lonely, I upgraded both 1.05 and 1.06 today, and the only problem I got was about the services-start script deleted on my /jffs partition. No trace on the installation log; 1.06 for example:

Code:
--------------------------------------------------
  AB-Solution 1.06 installation / upgrade
 --------------------------------------------------

 This script will guide through the installation.
 It will install files in the /adblocking/ directory on
 the device you select during install.

 A previous AB-Solution* installation will be upgraded.
 Some entries will be written to /jffs/scripts.

 A backup of existing scripts will be made in the
 backup directory on the device.

 *) Includes Adblock WCHFA, the former name of this script

 --------------------------------------------------

 Found a previous installation to upgrade on:

[0;92m --> /tmp/mnt/optware[00m

 Please confirm to upgrade: [1=Yes 2=Exit]  Input: 1

 Using /tmp/mnt/optware to upgrade AB-Solution

 Backing up /jffs/scripts/dnsmasq.postconf
 to /tmp/mnt/optware/adblocking/backup/dnsmasq.postconf_2016-03-26_18

 Backing up /jffs/scripts/post-mount
 to /tmp/mnt/optware/adblocking/backup/post-mount_2016-03-26_18

 Writing medium update-hosts.sh file

 Writing /tmp/mnt/optware/adblocking/scripts/ab_dnsmasq_postconf.sh
 (Adblocking and logging on)

 To follow the dnsmasq.log run this in a terminal:
 tail -f /tmp/mnt/optware/adblocking/logs/dnsmasq.log

 The logfile will rotate every Saturday @ 2:00 a.m.
 to dnsmasq.log.old

 Writing the whitelist.txt and blacklist.txt files
 to: /tmp/mnt/optware/adblocking/

 --------------------------------------------------
 To support SmallNetBuilder.com, some entries were
 added in the whitelist.txt file to allow ads on
 their websites. Please do not remove them. Thanks.

 --------------------------------------------------
 Amalgamating the Medium hosts file.
 This may take a little while to process.
 Verbose output follows:


Done.
 The hosts file will update every Saturday @ 2:00 a.m.

 To update manually, run this in a terminal:
 sh /tmp/mnt/optware/adblocking/scripts/update-hosts.sh

 Doing final checks if AB-Solution installed properly

 checking /jffs/scripts/dnsmasq.postconf
 OK, file found
 OK, file looks good

 checking /jffs/scripts/post-mount
 OK, file found
 OK, file looks good

 checking ab_dnsmasq_postconf.sh
 OK, file found
 OK, file looks good

 checking hosts-adblock
 OK, file found
 OK, file looks good

 checking ab-solution.cfg
 OK, file found
 OK, file looks good

 checking update-hosts.sh
 OK, file found
 OK, file looks good
 [0;92m--> Looking good, no problems found.[00m

 --------------------------------------------------
[0;92m  AB-Solution install or upgrade complete![00m
 --------------------------------------------------

 The install log is saved here:
 /tmp/mnt/optware/adblocking/logs/AB-Solution-1.06-install.log
 
Hi Lonely, I upgraded both 1.05 and 1.06 today, and the only problem I got was about the services-start script deleted on my /jffs partition. No trace on the installation log; 1.06 for example:

Code:
--------------------------------------------------
  AB-Solution 1.06 installation / upgrade
--------------------------------------------------

This script will guide through the installation.
It will install files in the /adblocking/ directory on
the device you select during install.

A previous AB-Solution* installation will be upgraded.
Some entries will be written to /jffs/scripts.

A backup of existing scripts will be made in the
backup directory on the device.

*) Includes Adblock WCHFA, the former name of this script

--------------------------------------------------

Found a previous installation to upgrade on:

[0;92m --> /tmp/mnt/optware[00m

Please confirm to upgrade: [1=Yes 2=Exit]  Input: 1

Using /tmp/mnt/optware to upgrade AB-Solution

Backing up /jffs/scripts/dnsmasq.postconf
to /tmp/mnt/optware/adblocking/backup/dnsmasq.postconf_2016-03-26_18

Backing up /jffs/scripts/post-mount
to /tmp/mnt/optware/adblocking/backup/post-mount_2016-03-26_18

Writing medium update-hosts.sh file

Writing /tmp/mnt/optware/adblocking/scripts/ab_dnsmasq_postconf.sh
(Adblocking and logging on)

To follow the dnsmasq.log run this in a terminal:
tail -f /tmp/mnt/optware/adblocking/logs/dnsmasq.log

The logfile will rotate every Saturday @ 2:00 a.m.
to dnsmasq.log.old

Writing the whitelist.txt and blacklist.txt files
to: /tmp/mnt/optware/adblocking/

--------------------------------------------------
To support SmallNetBuilder.com, some entries were
added in the whitelist.txt file to allow ads on
their websites. Please do not remove them. Thanks.

--------------------------------------------------
Amalgamating the Medium hosts file.
This may take a little while to process.
Verbose output follows:


Done.
The hosts file will update every Saturday @ 2:00 a.m.

To update manually, run this in a terminal:
sh /tmp/mnt/optware/adblocking/scripts/update-hosts.sh

Doing final checks if AB-Solution installed properly

checking /jffs/scripts/dnsmasq.postconf
OK, file found
OK, file looks good

checking /jffs/scripts/post-mount
OK, file found
OK, file looks good

checking ab_dnsmasq_postconf.sh
OK, file found
OK, file looks good

checking hosts-adblock
OK, file found
OK, file looks good

checking ab-solution.cfg
OK, file found
OK, file looks good

checking update-hosts.sh
OK, file found
OK, file looks good
[0;92m--> Looking good, no problems found.[00m

--------------------------------------------------
[0;92m  AB-Solution install or upgrade complete![00m
--------------------------------------------------

The install log is saved here:
/tmp/mnt/optware/adblocking/logs/AB-Solution-1.06-install.log
Was it an empty file or have you manually added entries to it?
The services-start file is no longer used (and needed) since v1.05 for AB-Solution and is removed during install / upgrade if it's empty.

The /jffs/scrips/post-mount file is now used to do its job.
 
Last edited:
it's possible to install on OFW ?
 
Was it an empty file or have you manually added entries to it?
The services-start file is no longer used (and needed) since v1.05 for AB-Solution and is removed during install / upgrade if it's empty.

The /jffs/scrips/post-mount file is now used to do its job.
The strange thing it's not empty. I use it for starting entware software by rc.unslung startup script

Inviato dal mio SM-G900F utilizzando Tapatalk
 
The strange thing it's not empty. I use it for starting entware software by rc.unslung startup script

Inviato dal mio SM-G900F utilizzando Tapatalk
Dio mio, sorry about that, should not happen.
Code:
sleep 10
/opt/etc/init.d/rc.unslung start
This was removed?
 
Dio mio, sorry about that, should not happen.
Code:
sleep 10
/opt/etc/init.d/rc.unslung start
This was removed?
Yep!

Parli anche italiano? [emoji16]

Inviato dal mio SM-G900F utilizzando Tapatalk
 
The strange thing it's not empty.
I have spotted the error in the code.
Will push it under the same version number to GitHub as soon as it's fixed.
Thanks for reporting!
 
@matthew_eli: Just tested it, this really should not have happened. The code works correctly on my system.
I'll do some more testing later tonight.
 
Just to add some info: I have a RT-AC88U with merlin 380.58 FW
 
Thanks for the new version. Nice to see it's going on.
Read your comment in V1.05 thread. Take your time.
In the meantime I'm playing with a filter driver to prevent Win 10 leaking issues. Not sure if it's possible to sort the good web accesses and unwanted ones via process name. We'll see.
 
Here's a small thing. If you have an ab-solution.sh downloaded and want to upgrade, wget will place ab-solution.sh.1 on the router. You have to run .sh.1 and not .sh to upgrade. When the script reloads, even if you have 1.06, you will get the 1.05 menu because it calls .sh not .sh.1.

Maybe it should be curl -o not wget? Or maybe in the thread you should say to delete the existing script first when upgrading?

Upgrade worked fine. Sort works fine (thanks!). Liked that it retained the existing whitelist/blacklist.
 
Here's a small thing. If you have an ab-solution.sh downloaded and want to upgrade, wget will place ab-solution.sh.1 on the router. You have to run .sh.1 and not .sh to upgrade. When the script reloads, even if you have 1.06, you will get the 1.05 menu because it calls .sh not .sh.1.

Maybe it should be curl -o not wget? Or maybe in the thread you should say to delete the existing script first when upgrading?
Good point, thanks.
As it's usually the /home/root/ directory you are downloading it to, the file gets wiped when rebooting.
That's unlikely to happen when you post 2 versions within one day! ;)

Using cURL has also the benefit of not needing to skip the certificate check for https on GitHub.
I am going to change post #1 to this:
Code:
curl -O https://raw.githubusercontent.com/decoderman/AB-Solution/master/ab-solution.sh

Upgrade worked fine. Sort works fine (thanks!). Liked that it retained the existing whitelist/blacklist.
Yup, doesn't touch the bl or wl if they already exist.
 
Last edited:
In the meantime I'm playing with a filter driver to prevent Win 10 leaking issues. Not sure if it's possible to sort the good web accesses and unwanted ones via process name. We'll see.
I hear you. But I want to concentrate on the v2.0 with a GUI now. I was very close to finish the add-on's, including Win10 tracking. But it may be a useless effort to finish it all if I have to redo it again for the GUI version.
AB-Solution v1.06 may be the last shell-script-only version that gets released, I hope.
 
@L&LD: Do you have AB-Solution running on your router? I remember you in the original 'Adblocking with combined hosts file' thread struggling with the manual install. I hope this is working now for you.
 
@L&LD: Do you have AB-Solution running on your router? I remember you in the original 'Adblocking with combined hosts file' thread struggling with the manual install. I hope this is working now for you.

Thanks for thinking of me. :)

I'll have a chance to install your latest 1.06 sometime next week, if version 2.0 (the full gui version!) doesn't come out first.
 
Thanks for thinking of me. :)

I'll have a chance to install your latest 1.06 sometime next week, if version 2.0 (the full gui version!) doesn't come out first.
Not likely to happen, have a go at the script version. It'll be fun!
 

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