diff options
author | Dirk Brenken <dev@brenken.org> | 2019-08-26 11:46:33 +0200 |
---|---|---|
committer | Dirk Brenken <dev@brenken.org> | 2019-08-26 14:09:39 +0200 |
commit | bd405bfed02851780d74f93f8286497e7f2af4d8 (patch) | |
tree | 34dc0642b5ab7955fe14bccaeabe573e56eb8a0a /applications/luci-app-adblock/luasrc/controller | |
parent | 2aab85814d0eead5f82ee1c5661f03667ce50b62 (diff) |
luci-app-adblock: sync with adblock 3.8.3
* fix a suspend/resume issue
* format overall domains with a thousands separator
Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'applications/luci-app-adblock/luasrc/controller')
-rw-r--r-- | applications/luci-app-adblock/luasrc/controller/adblock.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/applications/luci-app-adblock/luasrc/controller/adblock.lua b/applications/luci-app-adblock/luasrc/controller/adblock.lua index d75296275f..bee1d14396 100644 --- a/applications/luci-app-adblock/luasrc/controller/adblock.lua +++ b/applications/luci-app-adblock/luasrc/controller/adblock.lua @@ -53,12 +53,6 @@ function adb_action(name, ...) luci.sys.call("/etc/init.d/adblock resume >/dev/null 2>&1") elseif name == "do_refresh" then luci.sys.call("/etc/init.d/adblock reload >/dev/null 2>&1") - local pid_file = "/var/run/adblock.pid" - if nixio.fs.access(pid_file) then - repeat - nixio.nanosleep(1) - until nixio.fs.readfile(pid_file) == "" - end elseif name == "do_report" then luci.sys.call("/etc/init.d/adblock report " ..table.concat(report_params, " ").. " >/dev/null 2>&1") local rep_dir = uci:get("adblock", "extra", "adb_repdir") or "/tmp" @@ -90,6 +84,14 @@ function adb_action(name, ...) end end end + if name == "do_suspend" or name == "do_resume" or name == "do_refresh" then + local pid_file = "/var/run/adblock.pid" + if nixio.fs.access(pid_file) then + repeat + nixio.nanosleep(1) + until nixio.fs.readfile(pid_file) == "" + end + end luci.http.prepare_content("text/plain") luci.http.write("0") end |