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 52764cc925
commit 3d2511d488
1 changed files with 16 additions and 6 deletions

View File

@ -69,12 +69,22 @@ function f.handle(self, state, data)
uci:save("autoupdater")
uci:commit("autoupdater")
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")
uci:set("gluon-simple-tc", meshvpn_name, "limit_ingress", data._limit_ingress)
uci:set("gluon-simple-tc", meshvpn_name, "limit_egress", data._limit_egress)
uci:commit("gluon-simple-tc")
-- 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")