What's new
  • 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!

The raw link to the file, click on the icon and copy/paste the URL in the browser:

Thanks, I'll try that ASAP. However, there are more pressing matters, as Diversion crashed (lost connection) after updating the hosted whitelist, removing the hosted blacklist and processing them.

Now, my router isn't listing the USB device connected to it anymore ("no device" on the GUI under USB 2.0) and through SSH, it doesn't find any scripts (amtm, Diversion or Skynet). Help?

Edit: I've tried rebooting the router via the GUI a few times - no luck in getting the USB drive to appear again.
 
Does a hosted list substitute whatever Diversion ships with?
NO.
The main blocking list is and remains the blocking list in b. It may only be compiled from one hosts file or compiled from several hosts files. The Standard blocking list type only uses one hosts file: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
There are four predefined blocking lists to choose from in b: Small, Standard, Medium and Large. One can change the composition of each of them and add or remove hosts files from it. Such a blocking list is then renamed to Custom.

The whitelist in el contains entries that shall be removed from the blocking list. This lets one remove domains that are blocked and should not be.
The whitelist by default contains entries that allow ads to appear on this very website, to support SmallNetBuilders.
This list shall be brief and only contain domains that one explicitly does not want to be blocked.
For easier management, the option exists to use a hosted whitelist. This is of benefit when managing more than one router or simply because it may be more convenient to edit the file outside of the Diversion interface.

The blacklist in el contains entries that are not blocked by the blocking list. It is added to Dnsmasq separately from the blocking list and blocks ads.
This list shall be brief and only contain domains that one explicitly wants to block.
The option exists to use a hosted blacklist, see above for explanation.
The blacklist is not a substitute for the blocking list.

The wildcard blacklist in el is for advanced users.
 
Last edited:
NO.
The main blocking list is and remains the blocking list in b. It may only be compiled from one hosts files or several hosts files combined. The Standard blocking list type only uses one hosts file: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
There are four predefined blocking lists to choose from in b: Small, Standard, Medium and Large. One can change the composition of each of them and add or remove hosts files from it. Such a blocking list is then renamed to Custom.

The whitelist in el contains entries that shall be removed from the blocking list. This lets one remove domains that are blocked and should not be.
The whitelist by default contains entries that allow ads to appear on this very website, to support SmallNetBuilders.
This list shall be brief and only contain domains that one explicitly does not want to be blocked.
For easier management, the option exists to use a hosted whitelist. This is of benefit when managing more than one router or simply because it may be more convenient to edit the file outside of the Diversion interface.

The blacklist in el contains entries that are not blocked by the blocking list. It is added separately from the blocking list and blocks ads.
This list shall be brief and only contain domains that one explicitly wants to block.
The option to use a hosted blacklist, see above for explanation.
The blacklist is not a substitute for the blocking list.

The wildcard blacklist in el is for advanced users.

This is an excellent explanation, Martin. It’d be a shame if it gets lost as just another post in this thread. Could you repeat it somewhere - I’m not sure where’s best - where people are most likely to look for a deeper explanation of how things work?

Could it perhaps be appended to Post 1? Or perhaps added in Diversion.ch, with a link either in Post 1 or Post 2 directing people there for a detailed explanation of Diversion’s operation?
 
Last edited:
This is an excellent explanation, Martin. It’d a shame if it gets lost as just another post in this thread. Could you repeat it somewhere - I’m not sure where’s best - where people are most likely to look for a deeper explanation of how things work?

Could it perhaps be appended to Post 1? Or perhaps added in Diversion.ch, with a link either in Post 1 or Post 2 directing people there for a detailed explanation of Diversion’s operation?
I'll add it to the Diversion manual.
 
NO.
The main blocking list is and remains the blocking list in b. It may only be compiled from one hosts files or several hosts files combined. The Standard blocking list type only uses one hosts file: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
There are four predefined blocking lists to choose from in b: Small, Standard, Medium and Large. One can change the composition of each of them and add or remove hosts files from it. Such a blocking list is then renamed to Custom.

The whitelist in el contains entries that shall be removed from the blocking list. This lets one remove domains that are blocked and should not be.
The whitelist by default contains entries that allow ads to appear on this very website, to support SmallNetBuilders.
This list shall be brief and only contain domains that one explicitly does not want to be blocked.
For easier management, the option exists to use a hosted whitelist. This is of benefit when managing more than one router or simply because it may be more convenient to edit the file outside of the Diversion interface.

The blacklist in el contains entries that are not blocked by the blocking list. It is added separately from the blocking list and blocks ads.
This list shall be brief and only contain domains that one explicitly wants to block.
The option to use a hosted blacklist, see above for explanation.
The blacklist is not a substitute for the blocking list.

The wildcard blacklist in el is for advanced users.

I think I got it now. I was under the impression that the hosted lists worked as substitutes, since Diversion mentions that they will replace the default block lists. Thanks to your in-depth explanation, I have a better understanding of how exactly the script works.

I still have a few more questions, though:

1. What is the predefined blocking list in b: Small, Standard, Medium or Large?
2. The www/non-www domain should remain in its default setting ("off")?
3. No domains in the hosted whitelist can start with "www"? For some reason, in all the Xbox whitelists I found, two of the several domains in them included the full address ("www.domain.com").

Also, did you get a chance to read my post about the Diversion crash and the subsequent issue with the USB drive? Not sure what happened there, but a simple reboot didn't fix it.
 
You are missing the Entware grep binary /opt/bin/grep. For some reason there's a symlink there to presumably Entware's (or maybe your firmwares) BusyBox grep which does not support the switch I use in that file.

I think this will work, enter it into the terminal, it should install regular Entware grep:
Code:
opkg install grep
If you encounter an error, try removing the symlink:
Code:
rm /opt/bin/grep
then try to install it again.

Let me know if that works.

Indeed this solved my problem!
You are a genius!
Thank you so much!
 
Thank you for posting an explanation of how hosted lists work.

Immediately moved to hosted whitelist/blacklist/wc_blacklist to configure both routers I admin (in different locations).
 
Hi, guys.

Every time I run Diversion, it deletes the line that enables swap on /jffs/scripts/post-mount.

How can I disable that behaviour, or where can I put that line so it doesn't get deleted. Swap is on partition /dev/sda1.

Thanks.
 
Hi, guys.

Every time I run Diversion, it deletes the line that enables swap on /jffs/scripts/post-mount.

How can I disable that behaviour, or where can I put that line so it doesn't get deleted. Swap is on partition /dev/sda1.

Thanks.
Post the line from /jffs/scripts/post-mount for your swap file.
How was the swap file created?
 
Hi, guys.

Every time I run Diversion, it deletes the line that enables swap on /jffs/scripts/post-mount.

How can I disable that behaviour, or where can I put that line so it doesn't get deleted. Swap is on partition /dev/sda1.

Thanks.

Is your swap file managed by diversion? If not you might want to put the line in a different file and include that from the post-mount script.

Side note, does this work?
Code:
check_nl(){ [ "$(tail -c1 "${1}"; echo x)" != "$'\nx'" ] && echo >>"${1}";}
I don't think ANSI-C Quoting is supported by asusrwts busybox (seems to require being compiled with ENABLE_ASH_BASH_COMPAT).
Code:
$ [ "$(printf "\nx")" = "$'\nx'" ] && echo true || echo false
false
 
Side note, does this work?
Code:
check_nl(){ [ "$(tail -c1 "${1}"; echo x)" != "$'\nx'" ] && echo >>"${1}";}
I don't think ANSI-C Quoting is supported by asusrwts busybox (seems to require being compiled with ENABLE_ASH_BASH_COMPAT).
Code:
$ [ "$(printf "\nx")" = "$'\nx'" ] && echo true || echo false
false
I literally work on this right now as it always adds a new line despite me not wanting it.
I just want to make sure what gets appended to a file is on a new line and not at the end of an existing line without a LF.
 
It's the entire partition:
swapon /dev/sda1
A swap partition is not supported by amtm or Diversion. Since both cannot detect the expected swapfile, the line is removed.
 
Since $() eats newlines anyway, you could just check if the string is empty
Code:
[ -n "$(tail -c1 "$1")" ] && echo >> "$1"
Damn, thanks a lot, just what I needed right now as I was stuck on this!
 
Is your swap file managed by diversion? If not you might want to put the line in a different file and include that from the post-mount script.
I did it this way, thanks for the idea.

/jffs/scripts/swap-enable:
Code:
#!/bin/sh
swapon /dev/sda1

/jffs/scripts/post-mount:
Code:
#!/bin/sh
. /jffs/scripts/post-mount.div # Added by Diversion
. /jffs/scripts/swap-enable

A swap partition is not supported by amtm or Diversion. Since both cannot detect the expected swapfile, the line is removed.
Ok, thanks for the clarification, but even now that I did it as stated above, Diversion and AMTM keeps saying:
Code:
__________________| INFO |___________________

 No swap file found, reference removed in
 /jffs/scripts/post-mount
_____________________________________________

Is there anything to do to stop that? Thanks again.
 
Ok, thanks for the clarification, but even now that I did it as stated above, Diversion and AMTM keeps saying:
I see, the file is sourced and runs it's test on the/jffs/scripts/swap-enable, but does it actually remove anything?
 

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

Staff online

Top