Enable Guest Wifi by app and disable it after some periode

when friends of my kids are at home, i want my kids to be able to switch on the Guest Wifi by an app (or some hardware switch). After some periode the guest wifi should switch off again.
Right now I was able to use Fwknopd + Fwknop2 executing a dumb script I wrote to enable the Guest Wifi (uci set wireless.wifinet6.disabled='0' ...) and switch it off each night by a cron job. It works, but the actual solution is very hackish and the kids could use Fwknop2 and execute other scripts as well, Furthermore I want to enable the wifi only for some periode not the hole day long
So I was wondering if there exists a solution for this already or if someone knows a less hackish way for this?
thanx - ch

If you give a little bit more information about your setup will be great, what model and version the router is, and is it one router or its more then one that need to have this feture?

Thank you for your reply. Currently it's a simple setup. I use one router, a Linksys MR8300 running latest OpenWrt version (22.03.3) and a TP-Link TL-WDR 4300 as a wif range extender.

Have you tried something like:

# enable the Wi-Fi network
uci set wireless.wifinet6.disabled='1'

# set a timer for 1 hour (3600 seconds)
sleep 3600

# disable the Wi-Fi network
uci set wireless.wifinet6.disabled='0'

And then link that script or edit in a way that register when the wps button is pressed for example :slight_smile:

1 Like

Could try this: https://dougbeal.com/2019/11/02/remote-control-your-mac-with-your-iphone-and-ssh-key-shortcuts/

I know you can buy similar apps on the app store but it seem's nowadays this is built-in in iOS.

1 Like

oh boy. "sleep" it's the simple :man_facepalming: thanks a lot!
now i have to figure out, how i execute the script by pressing the wps button

i don't want to allow my kids to access the router by ssh. imo it's even worse then letting them execture a script through Fwknop2

1 Like

Im not relly sure if this will work or not ig you can try it out

nano /etc/hotplug.d/button/99-my_script


if [ "$BUTTON" = "wps" ] && [ "$ACTION" = "released" ]; then
    /root/my_script.sh &

chmod +x /etc/hotplug.d/button/99-my_script

Asuming that the script is located in /root/my_script.sh :slight_smile:

1 Like

thank you very much. i'll try that!

If that sloves the problem please dont forget to mark it as sloved :slight_smile:

The script works great. But the WPS button doesn't trigger it. I guess I have to read the hotplug docs.

1 Like

Okay, if thats all you can mark the problem as sloved :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.