For over a year now I've been wanting to install & use Diversion (i.e. the Router Ad-Blocker, pka AB-Solution) on my home router but never had time available. However, lately, with everyone in the household working from home or taking classes remotely for many months now due to the coronavirus pandemic, we've become more keenly aware of how ubiquitously intrusive a lot of web ads have become in the past few years, especially those pop-up ads that suddenly appear either dead center on the screen or to the side on top of an online article you've just started to read a few seconds before. I'm certain that I don't have to tell you how f'ing annoying those online ads are (excusez mon français :>).
So last night I decided to install Diversion Standard via amtm and check out how effective its ad-blocking capabilities are. Unfortunately, my initial impressions were not good at all due to what I consider to be installations or setup bugs. Before I start to explain, let me provide the initial installation context:
Router: RT-AC86U
Firmware: AsusWRT-Merlin 384.19_0
AMTM 3.1.8 version
One 32GB USB 3.1 Flash Drive on USB 3.0 Port (1 partition, ext4 format with journaling, ~26GB free)
One 128GB USB 3.0 Flash Drive on USB 2.0 Port (2 partitions, NTFS format, ~115GB free)
2GB swap file on 32GB USB 3.1 Drive.
Entware installed on 32GB USB 3.1 Drive.
Custom shell scripts: init-start, services-start, post-mount, unmount, dnsmasq.postconf, service-event-end, and my own scripts which are called from within those already listed.
No other 3rd-party shell scripts.
The problem was that after installing Diversion and rebooting the router twice, I did not notice any difference in the number of web ads being shown on various websites. In addition, I found a couple of clues which indicated that something had gone awry during the installation or initial configuration:
a) The Diversion CLI menu showed this line:
ep pixelserv-tls 172.25.250.2 (not running)
b) The system log file had this line:
Dec 1 19:54:24 Diversion: pixelserv-tls or Diversion disabled, not starting pixelserv-tls
After looking further at the log entries, I also noticed clues that 3 of the existing custom shell scripts had been modified during installation, and some new lines of code had been appended to or inserted in the wrong place, effectively rendering the necessary changes moot.
The "post-mount" shell script
---------------------------------
The "post-mount" shell script was modified with the insertion of the following 2 lines:
The "swapon" line above was inserted as the 2nd line in the script, but this was not necessary as that same line existed already in the script (I've had the swap file set up & running fine for almost a year now). But what made things worse is that the already existing "swapon" line was removed without any concern for the contextual construct in which the line was originally found (in this case, an if-statement).
The "mount-entware.div" line above was appended to the end of the script as the last line *AFTER* an existing "exit 0" line, leaving the newly inserted code with no effective and practical purpose because it would never be reached and executed. Also (as with the "swapon" line), that same line already existed in the script but was removed without any concern (again) for the contextual construct in which it was initially found.
The end result was that the custom script was left with 2 major errors:
- An existing "if statement" was left without any actual statements, which is a syntax error.
- The last inserted line is effectively useless and serves no purpose where it was placed.
Below are snippets of the script that shows what I just described.
ORIGINAL code in "post-mount" script *BEFORE* installation:
MODIFIED code in "post-mount" script *AFTER* installation:
As you can see above, the installation setup changes make the script fail and error out during execution.
[Continues on next post]...
So last night I decided to install Diversion Standard via amtm and check out how effective its ad-blocking capabilities are. Unfortunately, my initial impressions were not good at all due to what I consider to be installations or setup bugs. Before I start to explain, let me provide the initial installation context:
Router: RT-AC86U
Firmware: AsusWRT-Merlin 384.19_0
AMTM 3.1.8 version
One 32GB USB 3.1 Flash Drive on USB 3.0 Port (1 partition, ext4 format with journaling, ~26GB free)
One 128GB USB 3.0 Flash Drive on USB 2.0 Port (2 partitions, NTFS format, ~115GB free)
2GB swap file on 32GB USB 3.1 Drive.
Entware installed on 32GB USB 3.1 Drive.
Custom shell scripts: init-start, services-start, post-mount, unmount, dnsmasq.postconf, service-event-end, and my own scripts which are called from within those already listed.
No other 3rd-party shell scripts.
The problem was that after installing Diversion and rebooting the router twice, I did not notice any difference in the number of web ads being shown on various websites. In addition, I found a couple of clues which indicated that something had gone awry during the installation or initial configuration:
a) The Diversion CLI menu showed this line:
ep pixelserv-tls 172.25.250.2 (not running)
b) The system log file had this line:
Dec 1 19:54:24 Diversion: pixelserv-tls or Diversion disabled, not starting pixelserv-tls
After looking further at the log entries, I also noticed clues that 3 of the existing custom shell scripts had been modified during installation, and some new lines of code had been appended to or inserted in the wrong place, effectively rendering the necessary changes moot.
The "post-mount" shell script
---------------------------------
The "post-mount" shell script was modified with the insertion of the following 2 lines:
Code:
swapon /tmp/mnt/MyUSBDisk1/MySwapFile.swp # Added by amtm
Code:
. /jffs/addons/diversion/mount-entware.div # Added by Diversion
The "swapon" line above was inserted as the 2nd line in the script, but this was not necessary as that same line existed already in the script (I've had the swap file set up & running fine for almost a year now). But what made things worse is that the already existing "swapon" line was removed without any concern for the contextual construct in which the line was originally found (in this case, an if-statement).
The "mount-entware.div" line above was appended to the end of the script as the last line *AFTER* an existing "exit 0" line, leaving the newly inserted code with no effective and practical purpose because it would never be reached and executed. Also (as with the "swapon" line), that same line already existed in the script but was removed without any concern (again) for the contextual construct in which it was initially found.
The end result was that the custom script was left with 2 major errors:
- An existing "if statement" was left without any actual statements, which is a syntax error.
- The last inserted line is effectively useless and serves no purpose where it was placed.
Below are snippets of the script that shows what I just described.
ORIGINAL code in "post-mount" script *BEFORE* installation:
Code:
#!/bin/sh
########################################################
# ...[CUSTOM COMMENTS REMOVED]
########################################################
...[CUSTOM CODE REMOVED]
if [ -n "$1" ] && [ "$1" == "$MyUSB1_MOUNTpath" ]
then
# ADD-ONS #
swapon /tmp/mnt/MyUSBDisk1/MySwapFile.swp
. /jffs/addons/diversion/mount-entware.div
# ADD-ONS #
fi
_AddDebugLogMsgs_ "$EXIT_TAG" "OK: Exit."
exit 0
#EOF:post-mount#
MODIFIED code in "post-mount" script *AFTER* installation:
Code:
#!/bin/sh
swapon /tmp/mnt/MyUSBDisk1/MySwapFile.swp # Added by amtm
########################################################
# ...[CUSTOM COMMENTS REMOVED]
########################################################
...[CUSTOM CODE REMOVED]
if [ -n "$1" ] && [ "$1" == "$MyUSB1_MOUNTpath" ]
then
# ADD-ONS #
# ADD-ONS #
fi
_AddDebugLogMsgs_ "$EXIT_TAG" "OK: Exit."
exit 0
#EOF:post-mount#
. /jffs/addons/diversion/mount-entware.div # Added by Diversion
As you can see above, the installation setup changes make the script fail and error out during execution.
[Continues on next post]...