X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;ds=sidebyside;f=applications%2Fluci-app-vpnbypass%2Fluasrc%2Fmodel%2Fcbi%2Fvpnbypass.lua;h=18fbeaaf4123584d9ffbcd73e515e59615efe509;hb=7d87297e17643bfec6c65a367e779de8c4653eca;hp=b35a8e4e0291fc462ecd64de9858a3e37315c440;hpb=1b42d7a02df97c77ff9653de5e53b115610b3121;p=project%2Fluci.git diff --git a/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua b/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua index b35a8e4e0..18fbeaaf4 100644 --- a/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua +++ b/applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua @@ -1,22 +1,16 @@ readmeURL = "https://github.com/openwrt/packages/blob/master/net/vpnbypass/files/README.md" +uci = require "uci" + m = Map("vpnbypass", translate("VPN Bypass Settings")) s = m:section(NamedSection, "config", "vpnbypass") -- General options -e = s:option(Flag, "enabled", translate("Enable/start service")) +e = s:option(Flag, "enabled", translate("Start VPNBypass service")) e.rmempty = false - -function e.cfgvalue(self, section) - return self.map:get(section, "enabled") == "1" and luci.sys.init.enabled("vpnbypass") and self.enabled or self.disabled -end - function e.write(self, section, value) - if value == "1" then - luci.sys.call("/etc/init.d/vpnbypass enable >/dev/null") - luci.sys.call("/etc/init.d/vpnbypass start >/dev/null") - else - luci.sys.call("/etc/init.d/vpnbypass stop >/dev/null") + if value ~= "1" then + luci.sys.init.stop("vpnbypass") end return Flag.write(self, section, value) end @@ -56,6 +50,6 @@ s4.anonymous = true di = s4:option(DynamicList, "ipset", translate("Domains to Bypass"), translate("Domains to be accessed directly (outside of the VPN tunnel), see ") .. [[]] - .. translate("README") .. [[]] .. translate(" for syntax")) + .. translate("README") .. [[ ]] .. translate("for syntax")) return m, d