luci-app-adblock: sync with adblock 2.7.1 1188/head
authorDirk Brenken <dev@brenken.org>
Fri, 9 Jun 2017 18:18:23 +0000 (20:18 +0200)
committerDirk Brenken <dev@brenken.org>
Fri, 9 Jun 2017 18:18:23 +0000 (20:18 +0200)
* "Save & Reply" now distinguish between normal and manual/backup mode
  and triggers an appropriate reload or a start action

Signed-off-by: Dirk Brenken <dev@brenken.org>
applications/luci-app-adblock/luasrc/model/cbi/adblock/overview_tab.lua

index fe269656f32fd60b4915ed6087520d4f6f6dd837..38086c9eb42b3e181ed133cf91573d0fcb930a26 100644 (file)
@@ -17,7 +17,13 @@ m = Map("adblock", translate("Adblock"),
        .. "see online documentation</a>", "https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md"))
 
 function m.on_after_commit(self)
-       luci.sys.call("/etc/init.d/adblock reload >/dev/null 2>&1")
+       function e3.validate(self, value)
+               if value == "0" then
+                       luci.sys.call("/etc/init.d/adblock reload >/dev/null 2>&1")
+               else
+                       luci.sys.call("/etc/init.d/adblock start >/dev/null 2>&1")
+               end
+       end
        luci.http.redirect(luci.dispatcher.build_url("admin", "services", "adblock"))
 end