luci-app-vpnbypass: fix dispatcher bug when VPN node is present 3137/head
authorStan Grishin <stangri@melmac.net>
Wed, 2 Oct 2019 01:22:35 +0000 (18:22 -0700)
committerStan Grishin <stangri@melmac.net>
Wed, 2 Oct 2019 01:22:35 +0000 (18:22 -0700)
Signed-off-by: Stan Grishin <stangri@melmac.net>
applications/luci-app-vpnbypass/Makefile
applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua

index 2e26a5158e243f4ead9a6f6b158bbeb711bce4ab..51c3dafa7059c4b0342278dfc66e3287c6904993 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:=9
+PKG_RELEASE:=10
 
 include ../../luci.mk
 
index 95971fab1bf7a3c4f0d16000d70b1961bdea152c..75c681ec447abe019d039cb94853ff58bdc1b851 100644 (file)
@@ -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"))