diff options
author | Steven Barth <steven@midlink.org> | 2009-02-04 19:10:06 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2009-02-04 19:10:06 +0000 |
commit | 15029e4279f40b6444e203074bee3611638f7894 (patch) | |
tree | 0d1d44c35ed203e6052c94ca1bd4164caf7a73fb /modules/admin-mini | |
parent | 43844ccc0dde71e7a626397f9303b1b04109b6b5 (diff) |
Fix Wifi-Client mode for devices without standard default network configuration
Diffstat (limited to 'modules/admin-mini')
-rw-r--r-- | modules/admin-mini/luasrc/model/cbi/mini/wifi.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua b/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua index f3eed8e2c..e1d5b396b 100644 --- a/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua +++ b/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua @@ -15,6 +15,13 @@ $Id$ -- Data init -- +local uci = luci.model.uci.cursor() +if not uci:get("network", "wan") then + uci:section("network", "interface", "wan", {proto="none", ifname=" "}) + uci:save("network") + uci:commit("network") +end + local wlcursor = luci.model.uci.cursor_state() local wireless = wlcursor:get_all("wireless") local wifidata = luci.sys.wifi.getiwconfig() @@ -188,12 +195,6 @@ mode:value("sta", translate("m_w_client")) function mode.write(self, section, value) if value == "sta" then - -- ToDo: Move this away - if not m.uci:get("network", "wan") then - m.uci:set("network", "wan", "proto", "none") - m.uci:set("network", "wan", "ifname", " ") - end - local oldif = m.uci:get("network", "wan", "ifname") if oldif and oldif ~= " " then m.uci:set("network", "wan", "_ifname", oldif) |