simple-adblock: boot-up optimization
Signed-off-by: Stan Grishin <stangri@melmac.net>
This commit is contained in:
parent
665ec53cd8
commit
f7393b8813
2 changed files with 15 additions and 8 deletions
|
@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=simple-adblock
|
PKG_NAME:=simple-adblock
|
||||||
PKG_VERSION:=1.8.0
|
PKG_VERSION:=1.8.0
|
||||||
PKG_RELEASE:=0
|
PKG_RELEASE:=2
|
||||||
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
|
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
|
||||||
PKG_LICENSE:=GPL-3.0-or-later
|
PKG_LICENSE:=GPL-3.0-or-later
|
||||||
|
|
||||||
|
|
|
@ -704,7 +704,7 @@ boot() {
|
||||||
|
|
||||||
start_service() {
|
start_service() {
|
||||||
is_enabled 'on_start' || return 1
|
is_enabled 'on_start' || return 1
|
||||||
local ip status error action
|
local ip action status error message stats
|
||||||
if create_lock; then
|
if create_lock; then
|
||||||
procd_open_instance "main"
|
procd_open_instance "main"
|
||||||
procd_set_param command /bin/true
|
procd_set_param command /bin/true
|
||||||
|
@ -734,19 +734,20 @@ start_service() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
procd_close_instance
|
procd_close_instance
|
||||||
|
|
||||||
status="$(tmpfs get status)"
|
status="$(tmpfs get status)"
|
||||||
error="$(tmpfs get error)"
|
error="$(tmpfs get error)"
|
||||||
|
message="$(tmpfs get message)"
|
||||||
|
stats="$(tmpfs get stats)"
|
||||||
action="$(tmpfs get triggers)"
|
action="$(tmpfs get triggers)"
|
||||||
tmpfs set triggers
|
|
||||||
tmpfs del status
|
|
||||||
tmpfs del message
|
|
||||||
tmpfs del error
|
|
||||||
tmpfs del stats
|
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
download) action="download";;
|
download) action="download";;
|
||||||
restart|*)
|
restart|*)
|
||||||
if [ ! -s "$outputFile" ] && ! cacheOps 'test' && ! cacheOps 'testGzip'; then
|
if [ "$1" != "restart" ] && [ -s "$outputFile" ] && [ -n "$status" ]; then
|
||||||
|
status
|
||||||
|
exit 0
|
||||||
|
elif [ ! -s "$outputFile" ] && ! cacheOps 'test' && ! cacheOps 'testGzip'; then
|
||||||
action="download"
|
action="download"
|
||||||
elif cacheOps 'test' || cacheOps 'testGzip'; then
|
elif cacheOps 'test' || cacheOps 'testGzip'; then
|
||||||
action="start"
|
action="start"
|
||||||
|
@ -758,6 +759,12 @@ start_service() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
tmpfs del status
|
||||||
|
tmpfs del error
|
||||||
|
tmpfs del message
|
||||||
|
tmpfs del stats
|
||||||
|
tmpfs set triggers
|
||||||
|
|
||||||
case $action in
|
case $action in
|
||||||
download)
|
download)
|
||||||
if [ -s "$outputFile" ] || cacheOps 'test' || cacheOps 'testGzip'; then
|
if [ -s "$outputFile" ] || cacheOps 'test' || cacheOps 'testGzip'; then
|
||||||
|
|
Loading…
Reference in a new issue