summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-vpnbypass/luasrc/controller
diff options
context:
space:
mode:
authorStan Grishin <stangri@melmac.net>2019-09-07 10:36:32 -0700
committerStan Grishin <stangri@melmac.net>2019-09-07 10:36:32 -0700
commita34f260a2e1956f8fc5090ff60a8c925a05ff517 (patch)
treee546a5f80d3164af6eb7e0dd8efdc23b689d806d /applications/luci-app-vpnbypass/luasrc/controller
parent204293a7669490608a85ba765b697959c1ed169f (diff)
luci-app-vpnbypass: better start/stop controls, create entry in the VPN menu if it exists
Signed-off-by: Stan Grishin <stangri@melmac.net>
Diffstat (limited to 'applications/luci-app-vpnbypass/luasrc/controller')
-rw-r--r--applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua b/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua
index ed6f4f4da4..56221e043f 100644
--- a/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua
+++ b/applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua
@@ -1,7 +1,10 @@
module("luci.controller.vpnbypass", package.seeall)
function index()
- if not nixio.fs.access("/etc/config/vpnbypass") then
- return
+ if nixio.fs.access("/etc/config/vpnbypass") then
+ if luci.dispatcher.lookup("admin/vpn") then
+ entry({"admin", "vpn", "vpnbypass"}, cbi("vpnbypass"), _("VPN Bypass"))
+ else
+ entry({"admin", "services", "vpnbypass"}, cbi("vpnbypass"), _("VPN Bypass"))
+ end
end
- entry({"admin", "services", "vpnbypass"}, cbi("vpnbypass"), _("VPN Bypass"))
end