simple-adblock: boot-up optimization
authorStan Grishin <redacted>
Thu, 22 Aug 2019 23:34:14 +0000 (16:34 -0700)
committerStan Grishin <redacted>
Thu, 22 Aug 2019 23:34:14 +0000 (16:34 -0700)
Signed-off-by: Stan Grishin <redacted>
net/simple-adblock/Makefile
net/simple-adblock/files/simple-adblock.init

index 4e8024230c6a755e6bd8649b53ef935a4ba81d76..b887356bcaad95ce81f9f8be8b5049b568cf1428 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=simple-adblock
 PKG_VERSION:=1.8.0
-PKG_RELEASE:=0
+PKG_RELEASE:=2
 PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
 PKG_LICENSE:=GPL-3.0-or-later
 
index 9818bc6614cffe7fac1b439be1883430bacb8ded..68ad8f40a903a50184b445e4c7eab3348e26221a 100644 (file)
@@ -704,7 +704,7 @@ boot() {
 
 start_service() {
        is_enabled 'on_start' || return 1
-       local ip status error action
+       local ip action status error message stats
        if create_lock; then
                procd_open_instance "main"
                procd_set_param command /bin/true
@@ -734,19 +734,20 @@ start_service() {
                        fi
                fi
                procd_close_instance
+
                status="$(tmpfs get status)"
                error="$(tmpfs get error)"
+               message="$(tmpfs get message)"
+               stats="$(tmpfs get stats)"
                action="$(tmpfs get triggers)"
-               tmpfs set triggers
-               tmpfs del status
-               tmpfs del message
-               tmpfs del error
-               tmpfs del stats
 
                case "$1" in
                        download) action="download";;
                        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"
                                elif cacheOps 'test' || cacheOps 'testGzip'; then
                                        action="start"
@@ -758,6 +759,12 @@ start_service() {
                        ;;
                esac
 
+               tmpfs del status
+               tmpfs del error
+               tmpfs del message
+               tmpfs del stats
+               tmpfs set triggers
+
                case $action in
                        download)
                                if [ -s "$outputFile" ] || cacheOps 'test' || cacheOps 'testGzip'; then
git clone https://git.99rst.org/PROJECT