adblock: update 3.8.9

* more startup tweaks
* re-use f_log function in helper scripts
* small fixes / polish up for forthcoming 19.07 release

Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
Dirk Brenken
2019-11-06 20:29:48 +01:00
parent 9c82e9e282
commit 2c3cb6f1d1
5 changed files with 45 additions and 45 deletions
+6 -7
View File
@@ -15,14 +15,15 @@ adb_init="/etc/init.d/adblock"
adb_script="/usr/bin/adblock.sh"
adb_pidfile="/var/run/adblock.pid"
if [ -s "${adb_pidfile}" ] && [ "${action}" != "help" ] && [ "${action}" != "status" ]
if [ -s "${adb_pidfile}" ] && \
[ "${action}" != "help" ] && [ "${action}" != "status" ] && [ "${action}" != "boot" ]
then
exit 1
fi
boot()
{
adb_boot=1
[ -s "${adb_pidfile}" ] && > "${adb_pidfile}"
rc_procd start_service
}
@@ -30,19 +31,17 @@ start_service()
{
if [ "$("${adb_init}" enabled; printf "%u" ${?})" -eq 0 ]
then
if [ -n "${adb_boot}" ]
if [ "${action}" = "boot" ]
then
local trigger="$(uci_get adblock global adb_trigger)"
if [ "${trigger}" != "timed" ]
if [ "$(uci_get adblock global adb_trigger)" != "timed" ]
then
return 0
fi
fi
local nice="$(uci_get adblock extra adb_nice "0")"
procd_open_instance "adblock"
procd_set_param command "${adb_script}" "${@}"
procd_set_param pidfile "${adb_pidfile}"
procd_set_param nice "${nice}"
procd_set_param nice "$(uci_get adblock extra adb_nice "0")"
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance