From 4ac8e206e4c110a3a63b2c4d10fe09a89a190a89 Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Tue, 1 Oct 2019 18:22:47 -0700 Subject: [PATCH] luci-app-vpnbypass: fix dispatcher bug when VPN node is present Signed-off-by: Stan Grishin --- applications/luci-app-vpnbypass/Makefile | 2 +- .../luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/applications/luci-app-vpnbypass/Makefile b/applications/luci-app-vpnbypass/Makefile index 2e26a5158e..51c3dafa70 100644 --- a/applications/luci-app-vpnbypass/Makefile +++ b/applications/luci-app-vpnbypass/Makefile @@ -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:=9 +PKG_RELEASE:=10 include ../../luci.mk diff --git a/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua b/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua index 95971fab1b..75c681ec44 100644 --- a/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua +++ b/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua @@ -30,7 +30,11 @@ function en.write() sys.init.enable(packageName) sys.init.start(packageName) end - http.redirect(dispatcher.build_url("admin/services/" .. packageName)) + if dispatcher.lookup("admin/vpn") then + http.redirect(dispatcher.build_url("admin/vpn/" .. packageName)) + else + http.redirect(dispatcher.build_url("admin/services/" .. packageName)) + end end s = m:section(NamedSection, "config", "vpnbypass", translate("VPN Bypass Rules")) -- 2.30.2