Thanks for this great adblocker, I recently flashed my router and discovered this great tool. Thanks
@thelonelycoder.
So I search this thread and saw the discussion about wildcard whitelist. Completely understand and I just want to share my hack as for myself it is very useful. You know, wife keep yelling about some site not working so I keep turning off adblocking, then later still want give it try, turned it on then wife yelling again... you know what I mean
So here it is, it is a "hack" that use the simplest apprach, and treat the whitelist as wildcard list. It use string searching so following 2 style works but have different result:
.abcd.net -->
www.abcd.net will match,
www.xxabcd.net won't
abcd.net -->
www.xxabcd.net will match
Code:
--- /tmp/mnt/usbpen/entware/share/diversion/file/functions.div.orig
+++ /tmp/mnt/usbpen/entware/share/diversion/file/functions.div
@@ -4206,6 +4206,7 @@
sed -i "$(sed 's:.*:s/&/ /g:' ${DIVERSION_DIR}/list/whitelist.tmp)" "${DIVERSION_DIR}/list/$list"
sed -i "/^$blockingIPesc $\|^$blockingIPesc $/d" "${DIVERSION_DIR}/list/$list"
done
+ sed -i "$(sed 's# ##g;s#.*#s/[^[:blank:]]*&/ /g#' ${DIVERSION_DIR}/list/whitelist.tmp)" "${DIVERSION_DIR}/list/blockinglist"
if [ -s "/jffs/addons/shared-whitelists/shared-Diversion-whitelist" ]; then
/opt/bin/grep "^[^#]" "${DIVERSION_DIR}/list/whitelist" | awk '{print $1}' > "${DIVERSION_DIR}/list/shared-Diversion-whitelist.tmp"
As you can see, it only add one line to /tmp/mnt/usbpen/entware/share/diversion/file/functions.div
For the change to take effect, need "process" the white list, diversion menu el then 4.
If for any reason, the blockinglist file got messed up, please re-download the block list (diversion menu b, 4).
@thelonelycoder, this is my first post to the forum, and not sure you like others post hack to your official thread. If this is not good, let me know i will remove it. Again, thank you for this wonderful tool!