mirror of
https://github.com/openwrt/packages.git
synced 2025-12-26 11:16:31 +04:00
adblock: update 2.5.0
* revamp LuCI GUI (see luci repo for details)
* integrated runtime statistics in normal adblock ubus service instance
(see readme)
* simplified boot/init
* no longer use raw interface trigger
* use only network interface trigger, pre-configured for
'wan/wwan/lan' interfaces (see readme)
* fixed a reload issue
* removed switch to disable tld compression (seems to be pretty stable)
* muted awk parser if source list contains incorrect records
* raise dns backend timeout to 20 seconds
* documentation update
* cosmetics
Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
@@ -9,32 +9,24 @@ EXTRA_HELP=" suspend Suspend adblock processing
|
||||
resume Resume adblock processing
|
||||
query <DOMAIN> Query active blocklists for specific domain"
|
||||
|
||||
adb_init="/etc/init.d/adblock"
|
||||
adb_script="/usr/bin/adblock.sh"
|
||||
|
||||
boot()
|
||||
{
|
||||
local wanif4 wanif6 cnt=0 max_cnt=30
|
||||
local list iface="$(uci -q get adblock.global.adb_iface)"
|
||||
|
||||
. "/lib/functions/network.sh"
|
||||
while [ ${cnt} -le ${max_cnt} ]
|
||||
for name in ${iface}
|
||||
do
|
||||
network_find_wan wanif4
|
||||
network_find_wan6 wanif6
|
||||
if [ -n "${wanif4}" ] || [ -n "${wanif6}" ] || [ ${cnt} -eq ${max_cnt} ]
|
||||
then
|
||||
rc_procd start_service
|
||||
return 0
|
||||
else
|
||||
sleep 1
|
||||
cnt=$((cnt+1))
|
||||
network_flush_cache
|
||||
fi
|
||||
list="${list} network.interface.${name}"
|
||||
done
|
||||
ubus -t 60 wait_for network.interface ${list}
|
||||
rc_procd start_service
|
||||
}
|
||||
|
||||
start_service()
|
||||
{
|
||||
if [ $(/etc/init.d/adblock enabled; printf ${?}) -eq 0 ]
|
||||
if [ $("${adb_init}" enabled; printf ${?}) -eq 0 ]
|
||||
then
|
||||
procd_open_instance "adblock"
|
||||
procd_set_param command "${adb_script}" "${@}"
|
||||
@@ -44,11 +36,6 @@ start_service()
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service()
|
||||
{
|
||||
rc_procd start_service reload
|
||||
}
|
||||
|
||||
stop_service()
|
||||
{
|
||||
rc_procd "${adb_script}" stop
|
||||
@@ -61,12 +48,12 @@ restart()
|
||||
|
||||
suspend()
|
||||
{
|
||||
rc_procd start_service suspend
|
||||
rc_procd "${adb_script}" suspend
|
||||
}
|
||||
|
||||
resume()
|
||||
{
|
||||
rc_procd start_service resume
|
||||
rc_procd "${adb_script}" resume
|
||||
}
|
||||
|
||||
query()
|
||||
@@ -78,14 +65,9 @@ service_triggers()
|
||||
{
|
||||
local iface="$(uci -q get adblock.global.adb_iface)"
|
||||
|
||||
if [ -z "${iface}" ]
|
||||
then
|
||||
procd_add_raw_trigger "interface.*.up" 1000 /etc/init.d/adblock start
|
||||
else
|
||||
for name in ${iface}
|
||||
do
|
||||
procd_add_interface_trigger "interface.*.up" "${name}" /etc/init.d/adblock start
|
||||
done
|
||||
fi
|
||||
procd_add_config_trigger "config.change" "adblock" /etc/init.d/adblock start
|
||||
for name in ${iface}
|
||||
do
|
||||
procd_add_interface_trigger "interface.*.up" "${name}" "${adb_init}" start
|
||||
done
|
||||
procd_add_config_trigger "config.change" "adblock" "${adb_init}" start
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user