Hi,
I would like to switch wifi on/off with a http request. Is there a possibility to perform this?
I only found a way to toggle wifi acording to a shedule on the router with a config file, but that is not the way I would like to handle it.
Even if you manage to do this (and I suspect it would require writing your own code in the uhttpd or in luci to handle the inbound request), keep in mind that if YOU can do it, someone ELSE can as well..
…and once the wifi is off, your (wifi connected-) phone can't re-enable it, which -while not the only option- probably would be the most common expectations these days.
--
insert something about ssh keys, and invoking /sbin/wifi here, even if that wouldn't be a great idea either.
An elegant solution would be to install php on the router, and write a short PHP-script to edit /etc/config/wireless . Or just to emit a shell cmd like 'wifi down' .
PHP can be used with uhttpd.
Please limit your LuCi to only service your LAN and not the default binding of Any interface, if you are going to do this. Ideally, an Admin VLAN if possible.
True, but then again, the OP asked about http. Sometimes, we have to protect those without certain knowledge-sets from themselves.
I just looked, and below is the default settings from opkg install luci-ssl on the Snapshot I just built.. Those are unbound IP listen addresses, even if the Firewall is keeping it from coming in on WAN, it could.
once upon a time... I tried this... whilst the recommendation is sound... in practice, it can create complications when toying with networking/vlans etc. ( especially for general users )
mac/vlsm based firewall rulesets are a likely a little more forgiving in this regard...
Thinking your beyond reach is never a good idea. However! You will better be able to weigh your exposure vs likelihood, I just wanted to give you another point of view