adblock: update 1.2.1

* small optimizations & cosmetics

Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
Dirk Brenken
2016-06-14 22:25:02 +02:00
parent 8ab3d8bdc2
commit 672dd10b10
4 changed files with 71 additions and 62 deletions

View File

@@ -2,12 +2,11 @@
#
START=99
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
EXTRA_COMMANDS="toggle cfgup"
EXTRA_HELP=" toggle Toggle adblocking 'on' or 'off'
cfgup Update the adblock configuration file"
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
adb_debug=0
if [ $((adb_debug)) -eq 0 ]
then
@@ -74,7 +73,7 @@ reload()
stop()
{
cfg_check="$(${adb_uci} -q get "adblock.global.adb_overall_count")"
if [ -n "${cfg_check}" ]
if [ -n "${cfg_check}" ] && [ -z "${restart}" ]
then
. "/lib/functions.sh"
config_load adblock
@@ -83,12 +82,9 @@ stop()
"${adb_uci}" -q delete "adblock.global.adb_overall_count"
"${adb_uci}" -q delete "adblock.global.adb_percentage"
"${adb_uci}" -q delete "adblock.global.adb_lastrun"
if [ -z "${restart}" ]
then
"${adb_uci}" -q commit "adblock"
fi
"${adb_uci}" -q commit "adblock"
fi
fw_check="$(iptables -w -t nat -nL | grep -F "adb-")"
fw_check="$(iptables -w -vnL | grep -Fo "adb-")"
if [ -n "${fw_check}" ] && [ -z "${restart}" ]
then
iptables-save -t nat | grep -Fv -- "adb-" | iptables-restore