diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-11-02 18:59:18 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-11-02 18:59:18 +0000 |
commit | eea1f8b6795593c659658f4ef74ae074ee3ab740 (patch) | |
tree | 6c29a66202ac31875a4db4b24b91b22e98cee159 /modules/admin-full/luasrc/controller | |
parent | 89fb9f90842941e36355cb4aa32bbef100756df7 (diff) |
modules/admin-full: when toggling a wifi-iface, first bring the radio down, then change the config, then bring it up again - prevents state vars from going out of sync
Diffstat (limited to 'modules/admin-full/luasrc/controller')
-rw-r--r-- | modules/admin-full/luasrc/controller/admin/network.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/admin-full/luasrc/controller/admin/network.lua b/modules/admin-full/luasrc/controller/admin/network.lua index 40856af2c..a79d080a7 100644 --- a/modules/admin-full/luasrc/controller/admin/network.lua +++ b/modules/admin-full/luasrc/controller/admin/network.lua @@ -227,8 +227,7 @@ function iface_status() local net = netm:get_network(iface) local device = net and net:get_interface() if device then - local device = net:get_interface() - local data = { + local data = { id = iface, proto = net:proto(), uptime = net:uptime(), @@ -374,11 +373,13 @@ function wifi_reconnect() local net = netmd:get_wifinet(wnet) local dev = net:get_device() if dev and net then + luci.sys.call("env -i /sbin/wifi down >/dev/null 2>/dev/null") + dev:set("disabled", nil) net:set("disabled", (mode == "wireless_shutdown") and 1 or nil) netmd:commit("wireless") - luci.sys.call("(env -i /sbin/wifi down; env -i /sbin/wifi up) >/dev/null 2>/dev/null") + luci.sys.call("env -i /sbin/wifi up >/dev/null 2>/dev/null") luci.http.status(200, (mode == "wireless_shutdown") and "Shutdown" or "Reconnected") return |