From 217a5f17e3bbd1d65eceb40b6afa59469efc1dc7 Mon Sep 17 00:00:00 2001 From: CyrusFox Date: Sat, 10 Oct 2015 00:35:39 +0200 Subject: [PATCH] Fixed 0300-mesh-vpn.lua --- .../files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/gluon-config-mode-tunneldigger/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua b/package/gluon-config-mode-tunneldigger/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua index 066dc503..dced6fb7 100755 --- a/package/gluon-config-mode-tunneldigger/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua +++ b/package/gluon-config-mode-tunneldigger/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua @@ -12,11 +12,11 @@ function M.section(form) 'your connection\'s bandwidth available for the network. You can limit how ' .. 'much bandwidth the node will use at most.') local s = form:section(cbi.SimpleSection, nil, msg) - + local o - o = s:option(cbi.Flag, "_meshvpn", i18n.translate("Use internet connection (mesh VPN via L2TP")")) - o.default = uci:get_bool("tunneldigger", "broker", "enabled") and o.enabled or o.disabled + o = s:option(cbi.Flag, "_meshvpn", i18n.translate("Use internet connection (mesh VPN via L2TP)")) + o.default = uci:get_bool("tunneldigger", uci:get_first("tunneldigger", "broker"), "enabled") and o.enabled or o.disabled o.rmempty = false o = s:option(cbi.Flag, "_limit_enabled", i18n.translate("Limit bandwidth")) @@ -38,7 +38,7 @@ function M.section(form) end function M.handle(data) - uci:set("tunneldigger", "broker", "enabled", data._meshvpn) + uci:set("tunneldigger", uci:get_first("tunneldigger", "broker"), "enabled", data._meshvpn) uci:save("tunneldigger") uci:commit("tunneldigger")