adblock: update 1.4.8

* enhance the new query function:
   change the regex to find only the relevant blocklist entries
   add a recursive tld search to quickly identify domains for
whitelisting (see documentation)
     better result preparation
* add securemecca as new blocklist source
* documentation update

Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
Dirk Brenken
2016-08-28 21:37:35 +02:00
parent b31f99823c
commit ba1c55f0af
5 changed files with 72 additions and 29 deletions
+19 -4
View File
@@ -131,12 +131,27 @@ cfgup()
query()
{
if [ -z "${1}" ]
local search
local domain="${1}"
local tld="${domain#*.}"
if [ -z "${domain}" ] || [ "${domain}" = "${tld}" ]
then
f_log "no domain query input, please submit a specific search domain"
f_log "invalid domain query input, please submit a specific (sub-)domain, i.e. 'www.abc.xyz'"
else
f_log "results for search domain '${1}':"
grep "${1}" "/tmp/dnsmasq.d/adb_list"*
while [ "${domain}" != "${tld}" ]
do
search="${domain//./\.}"
result="$(grep -Hnm 3 "[/\.]${search}/" "/tmp/dnsmasq.d/adb_list"* | sed -e 's/^/ /')"
printf "%s\n" "=> results for (sub-)domain '${domain}'"
if [ -z "${result}" ]
then
printf "%s\n" " no matches in active blocklists"
else
printf "%s\n" "${result}"
fi
domain="${tld}"
tld="${domain#*.}"
done
fi
return 0
}