mirror of
https://github.com/openwrt/packages.git
synced 2026-01-10 03:41:29 +00:00
adblock: update to 1.1.1
* discard uncommitted uci changes in case of processing errors * init script (stop action) now removes all 'adb_src_count' & 'adb_src_timestamp' entries in config * updated documentation Signed-off-by: Dirk Brenken <openwrt@brenken.org>
This commit is contained in:
committed by
Dirk Brenken
parent
b9aeb82c95
commit
262f4551e2
@@ -8,6 +8,7 @@ adb_pid="${$}"
|
||||
adb_script="/usr/bin/adblock-update.sh"
|
||||
adb_pidfile="/var/run/adblock.pid"
|
||||
adb_logger="/usr/bin/logger"
|
||||
adb_uci="/sbin/uci"
|
||||
|
||||
if [ -t 1 ]
|
||||
then
|
||||
@@ -24,6 +25,15 @@ then
|
||||
exit 255
|
||||
fi
|
||||
|
||||
remove_config()
|
||||
{
|
||||
local value opt section="${1}" options="adb_src_timestamp adb_src_count"
|
||||
for opt in ${options}
|
||||
do
|
||||
${adb_uci} -q delete "adblock.${section}.${opt}"
|
||||
done
|
||||
}
|
||||
|
||||
boot()
|
||||
{
|
||||
return 0
|
||||
@@ -53,10 +63,11 @@ stop()
|
||||
rc=${?}
|
||||
if [ $((rc)) -eq 0 ] && [ -n "${rm_done}" ]
|
||||
then
|
||||
. "/usr/bin/adblock-helper.sh"
|
||||
uci_remove "adblock" "global" "adb_overall_count"
|
||||
f_rmconfig "${rm_done}"
|
||||
uci_commit "adblock"
|
||||
. "/lib/functions.sh"
|
||||
config_load adblock
|
||||
config_foreach remove_config source
|
||||
${adb_uci} -q delete "adblock.global.adb_overall_count"
|
||||
${adb_uci} -q commit "adblock"
|
||||
/etc/init.d/dnsmasq restart
|
||||
/etc/init.d/firewall restart
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user