"/sbin/firstboot": [ "exec" ],
"/sbin/reboot": [ "exec" ],
"/sbin/sysupgrade": [ "exec" ],
+ "/sbin/wifi": [ "exec" ],
"/bin/tar": [ "exec" ],
"/bin/umount": [ "exec" ],
"/tmp/backup.tar.gz": [ "write" ],
'use strict';
+'require fs';
'require rpc';
'require uci';
'require form';
if (dsc.getAttribute('restart') == '') {
dsc.setAttribute('restart', '1');
- tasks.push(L.Request.post(
- L.url('admin/network/wireless_reconnect', section_ids[i]),
- 'token=' + L.env.token,
- { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }
- ).catch(function() {}));
+ tasks.push(fs.exec('/sbin/wifi', ['up', section_ids[i]]).catch(function(e) {
+ L.ui.addNotification(null, E('p', e.message));
+ }));
}
else if (dsc.getAttribute('restart') == '1') {
dsc.removeAttribute('restart');
end)
if has_wifi then
- page = entry({"admin", "network", "wireless_reconnect"}, post("wifi_reconnect"), nil)
- page.leaf = true
-
page = entry({"admin", "network", "wireless"}, view("network/wireless"), _('Wireless'), 15)
page.leaf = true
end
luci.http.status(404, "No such interface")
end
-function wifi_reconnect(radio)
- local rc = luci.sys.call("env -i /sbin/wifi up %s >/dev/null" % luci.util.shellquote(radio))
-
- if rc == 0 then
- luci.http.status(200, "Reconnected")
- else
- luci.http.status(500, "Error")
- end
-end
-
function diag_command(cmd, addr)
if addr and addr:match("^[a-zA-Z0-9%-%.:_]+$") then
luci.http.prepare_content("text/plain")