include $(TOPDIR)/rules.mk
PKG_NAME:=adblock
-PKG_VERSION:=1.1.16
-PKG_RELEASE:=2
+PKG_VERSION:=1.1.17
+PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
* => weekly updates, approx. 12.000 entries
* [winhelp](http://winhelp2002.mvps.org)
* => infrequent updates, approx. 15.000 entries
- * [winspy](https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/hosts/windows10_spy.txt)
+ * [winspy](https://github.com/crazy-max/WindowsSpyBlocker)
* => infrequent updates, approx. 120 entries
* [yoyo](http://pgl.yoyo.org/adservers)
* => weekly updates, approx. 2.500 entries (enabled by default)
* **list updates:** for a scheduled call of the adblock service add an appropriate crontab entry (see example below)
* **new list sources:** you could add new blocklist sources on your own via uci config, all you need is a source url and an awk one-liner (see example below)
* **AP mode:** in AP mode adblock uses automatically the local router ip as nullip address. To make sure that your LuCI interface will be still accessible, please change the local uhttpd instance to ports <> 80/443 (see example below)
+* **Restricted mode:** to disable flash writes with adblock status information to the adblock config file (used by LuCI frontend), please set 'adb\_restricted' to '1'
* **adblock toggle:** to quickly switch adblocking 'on' or 'off', simply use _/etc/init.d/adblock toggle_
-* **outdated configuration:** to update an outdated adblock config file, please use _/etc/init.d/adblock cfgup_, make your individual changes and restart the adblock service
+* **configuration update:** to update an outdated adblock config file with the current default version, please run _/etc/init.d/adblock cfgup_, make your individual changes and start the adblock service again
* **debugging:** for script debugging please set the 'adb\_debug' variable in the header of _/etc/init.d/adblock_ to '1'
* **disable active dns probing in windows:** to prevent a possible yellow exclamation mark on your internet connection icon (which wrongly means connected, but no internet), please change the following registry key/value from "1" to "0" _HKLM\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet\EnableActiveProbing_
* adb\_nullport => port of the adblock uhttpd instance (default: '65535')
* adb\_nullipv4 => IPv4 blackhole ip address (default: '192.0.2.1', in AP mode: local router ip)
* adb\_nullipv6 => IPv6 blackhole ip address (default: '::ffff:c000:0201', in AP mode: local router ip)
- * adb\_forcedns => redirect all DNS queries to local dnsmasq resolver (default: '1', enabled)
+ * adb\_forcedns => redirect all local DNS queries to the local dnsmasq resolver (default: '1', enabled)
* adb\_fetchttl => set the timeout for list downloads (default: '5' seconds)
* adb\_restricted => disable updates of the adblock config file (no flash writes) during runtime (default: '0', disabled)
# check running dnsmasq instance
#
- check="$(ps | pgrep -f "dnsmasq")"
+ check="$(pgrep -f "dnsmasq")"
if [ -z "${check}" ]
then
rc=-1
# check volatile adblock uhttpd instance configuration
#
- check="$(ps | pgrep -f "uhttpd -h /www/adblock")"
+ check="$(pgrep -f "uhttpd -h /www/adblock")"
if [ -z "${check}" ]
then
if [ -n "${adb_wanif4}" ] && [ -n "${adb_wanif6}" ]
then
/etc/init.d/dnsmasq restart
sleep 1
- check="$(ps | pgrep -f "dnsmasq")"
+ check="$(pgrep -f "dnsmasq")"
if [ -n "${check}" ]
then
rc=0
#
LC_ALL=C
-# quiet output if 'adb_debug' not set
-#
-if [ -z "${adb_debug}" ]
-then
- exec 2>/dev/null
-fi
-
# set pid & logger
#
adb_pid="${$}"
# get current directory and set script/config version
#
adb_scriptdir="${0%/*}"
-adb_scriptver="1.1.16"
-adb_mincfgver="2.0"
+adb_scriptver="1.1.17"
+adb_mincfgver="2.1"
# source in adblock function library
#
"${adb_uci}" -q set "adblock.global.adb_dnstoggle=on"
/etc/init.d/dnsmasq restart
sleep 1
- check="$(ps | pgrep -f "dnsmasq")"
+ check="$(pgrep -f "dnsmasq")"
if [ -n "${check}" ]
then
f_log "adblock lists with overall ${adb_count} domains loaded"
config adblock 'global'
option adb_enabled '1'
- option adb_cfgver '2.0'
+ option adb_cfgver '2.1'
option adb_whitelist '/etc/adblock/adblock.whitelist'
option adb_whitelist_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
option adb_forcedns '1'
config source 'winspy'
option enabled '0'
- option adb_src 'https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/hosts/windows10_spy.txt'
+ option adb_src 'https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/win10/spy.txt'
option adb_src_rset '\$0 ~/^0\.0\.0\.0[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
option adb_src_desc 'focus on windows spy & telemetry domains, infrequent updates, approx. 120 entries'
adb_pidfile="/var/run/adblock.pid"
adb_log="$(which logger)"
adb_uci="$(which uci)"
-if [ "$(${adb_uci} -q get "adblock.global.adb_restricted")" = "1" ]
-then
- adb_uci="$(which true)"
-fi
if [ -t 1 ]
then
/etc/init.d/dnsmasq restart
/etc/init.d/firewall restart
fi
- uhttpd_pid="$(ps | pgrep -f "uhttpd -h /www/adblock")"
+ uhttpd_pid="$(pgrep -f "uhttpd -h /www/adblock")"
if [ -n "${uhttpd_pid}" ]
then
kill -9 "${uhttpd_pid}"
toggle()
{
+ if [ "$(${adb_uci} -q get "adblock.global.adb_restricted")" = "1" ]
+ then
+ adb_uci="$(which true)"
+ fi
if [ -d "${adb_dnshidedir}" ]
then
list_dns="$(find "${adb_dnsdir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print)"
"${adb_log}" ${log_parm} -t "adblock[${adb_pid}] info " "toggle for adblocking switched 'on'" 2>&1
fi
fi
+ return 0
}
cfgup()