提交 f3973132 编写于 作者: J Jo-Philipp Wich

modules/admin-full: commit uci and restart corresponding radio when removing wifi networks

上级 c3e89766
......@@ -198,9 +198,17 @@ end
function wifi_delete(network)
local ntm = require "luci.model.network".init()
local net = ntm:get_wifinet(network)
ntm:del_wifinet(network)
ntm:save("wireless")
if net then
local dev = net:get_device()
if dev then
luci.sys.call("env -i /sbin/wifi down %q" % dev:name())
ntm:del_wifinet(network)
ntm:commit("wireless")
luci.sys.call("env -i /sbin/wifi up %q" % dev:name())
end
end
luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless"))
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册