luci-app-vpnbypass: bugfix: properly restart dnsmasq
Signed-off-by: Stan Grishin <stangri@melmac.net>
This commit is contained in:
parent
d5ffab23b6
commit
94b8da9e4f
2 changed files with 5 additions and 4 deletions
|
@ -10,7 +10,7 @@ LUCI_TITLE:=VPN Bypass Web UI
|
||||||
LUCI_DESCRIPTION:=Provides Web UI for VPNBypass service.
|
LUCI_DESCRIPTION:=Provides Web UI for VPNBypass service.
|
||||||
LUCI_DEPENDS:=+luci-mod-admin-full +vpnbypass
|
LUCI_DEPENDS:=+luci-mod-admin-full +vpnbypass
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
PKG_RELEASE:=10
|
PKG_RELEASE:=11
|
||||||
|
|
||||||
include ../../luci.mk
|
include ../../luci.mk
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ local uci = require "luci.model.uci".cursor()
|
||||||
local sys = require "luci.sys"
|
local sys = require "luci.sys"
|
||||||
local http = require "luci.http"
|
local http = require "luci.http"
|
||||||
local dispatcher = require "luci.dispatcher"
|
local dispatcher = require "luci.dispatcher"
|
||||||
|
local util = require "luci.util"
|
||||||
en = h:option(Button, "__toggle")
|
en = h:option(Button, "__toggle")
|
||||||
if enabledFlag ~= "1" then
|
if enabledFlag ~= "1" then
|
||||||
en.title = translate("Service is disabled/stopped")
|
en.title = translate("Service is disabled/stopped")
|
||||||
|
@ -31,9 +32,9 @@ function en.write()
|
||||||
sys.init.start(packageName)
|
sys.init.start(packageName)
|
||||||
end
|
end
|
||||||
if dispatcher.lookup("admin/vpn") then
|
if dispatcher.lookup("admin/vpn") then
|
||||||
http.redirect(dispatcher.build_url("admin/vpn/" .. packageName))
|
http.redirect(dispatcher.build_url("admin", "vpn", packageName))
|
||||||
else
|
else
|
||||||
http.redirect(dispatcher.build_url("admin/services/" .. packageName))
|
http.redirect(dispatcher.build_url("admin", "services", packageName))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -76,7 +77,7 @@ di = s4:option(DynamicList, "ipset", translate("Domains to Bypass"),
|
||||||
.. [[<a href="]] .. readmeURL .. [[#bypass-domains-formatsyntax" target="_blank">]]
|
.. [[<a href="]] .. readmeURL .. [[#bypass-domains-formatsyntax" target="_blank">]]
|
||||||
.. translate("README") .. [[</a> ]] .. translate("for syntax"))
|
.. translate("README") .. [[</a> ]] .. translate("for syntax"))
|
||||||
function d.on_after_commit(map)
|
function d.on_after_commit(map)
|
||||||
sys.init.restart("dnsmasq")
|
util.exec("/etc/init.d/dnsmasq restart >/dev/null 2>&1")
|
||||||
end
|
end
|
||||||
|
|
||||||
return m, d
|
return m, d
|
||||||
|
|
Loading…
Reference in a new issue