gluon-config-mode: fix wizard

Due to my previous two commits configmode was broken when either meshvpn
or bandwidth limit was disabled. This fixes it but there may be a
cleaner solution provided by luci.
This commit is contained in:
Nils Schneider 2014-01-21 22:19:25 +01:00
parent 566faeb6ca
commit 5b8e044893

View File

@ -69,12 +69,22 @@ function f.handle(self, state, data)
uci:save("autoupdater")
uci:commit("autoupdater")
-- checks for nil needed due to o:depends(...)
if data._limit_enabled ~= nil then
uci:set("gluon-simple-tc", meshvpn_name, "interface")
uci:set("gluon-simple-tc", meshvpn_name, "enabled", data._limit_enabled)
uci:set("gluon-simple-tc", meshvpn_name, "ifname", "mesh-vpn")
if data._limit_ingress ~= nil then
uci:set("gluon-simple-tc", meshvpn_name, "limit_ingress", data._limit_ingress)
end
if data._limit_egress ~= nil then
uci:set("gluon-simple-tc", meshvpn_name, "limit_egress", data._limit_egress)
end
uci:commit("gluon-simple-tc")
end
uci:set("fastd", meshvpn_name, "enabled", data._meshvpn)
uci:save("fastd")