luci-app-vpnbypass: bugfix: properly restart dnsmasq 3211/head
authorStan Grishin <stangri@melmac.net>
Fri, 18 Oct 2019 14:14:16 +0000 (07:14 -0700)
committerStan Grishin <stangri@melmac.net>
Fri, 18 Oct 2019 14:14:16 +0000 (07:14 -0700)
Signed-off-by: Stan Grishin <stangri@melmac.net>
applications/luci-app-vpnbypass/Makefile
applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua

index 51c3dafa7059c4b0342278dfc66e3287c6904993..7c89090072b07813d7241da3a5bba9ff28759e5d 100644 (file)
@@ -10,7 +10,7 @@ LUCI_TITLE:=VPN Bypass Web UI
 LUCI_DESCRIPTION:=Provides Web UI for VPNBypass service.
 LUCI_DEPENDS:=+luci-mod-admin-full +vpnbypass
 LUCI_PKGARCH:=all
-PKG_RELEASE:=10
+PKG_RELEASE:=11
 
 include ../../luci.mk
 
index 75c681ec447abe019d039cb94853ff58bdc1b851..e3c5753f4c28569afd416af62a6bd7acf38c4d02 100644 (file)
@@ -8,6 +8,7 @@ local uci = require "luci.model.uci".cursor()
 local sys = require "luci.sys"
 local http = require "luci.http"
 local dispatcher = require "luci.dispatcher"
+local util = require "luci.util"
 en = h:option(Button, "__toggle")
 if enabledFlag ~= "1" then
        en.title      = translate("Service is disabled/stopped")
@@ -31,9 +32,9 @@ function en.write()
                sys.init.start(packageName)
        end
        if dispatcher.lookup("admin/vpn") then
-               http.redirect(dispatcher.build_url("admin/vpn/" .. packageName))
+               http.redirect(dispatcher.build_url("admin", "vpn", packageName))
        else
-               http.redirect(dispatcher.build_url("admin/services/" .. packageName))
+               http.redirect(dispatcher.build_url("admin", "services", packageName))
        end
 end
 
@@ -76,7 +77,7 @@ di = s4:option(DynamicList, "ipset", translate("Domains to Bypass"),
                .. [[<a href="]] .. readmeURL .. [[#bypass-domains-formatsyntax" target="_blank">]]
     .. translate("README") .. [[</a> ]] .. translate("for syntax"))
 function d.on_after_commit(map)
-    sys.init.restart("dnsmasq")
+       util.exec("/etc/init.d/dnsmasq restart >/dev/null 2>&1")
 end
 
 return m, d