Wifi scheduling that can be overridden by the button?

Hello! I have a Fritzbox 4020 with OpenWRT as a dumb IP. It is behind Mikrotik hEX lite (which is behind Fritzbox 5530) with Stock firmware. I put FB4020 there because this mikrotik doesn't have wifi, and also I'm very unfamiliar with mikrotik RouterOS, so I set ping-monitor on FB4020. Mikrotik is for boilers: I got it because the manufacturer of the boilers told me that it's the only router that works well with their things.
Fritzbox 4020 has a button to turn wifi on and off. I mean to have it off when I don't need it, I'm very rarely there. If I forget to turn it off, it's on for days/weeks. So a gardener noticed that there is a wifi there, and he asked me to let him use it during the break at a near-by shack. So I want to turn it on for him. I would like to set up a schedule to suit his needs, but so that in case I need to check something there, I could turn it on with the button, without logging in. I am afraid that if I use
`wireless.radio0.disabled='1'
with cron, I cannot turn it on using the button, right?
Is there any way I could do the wifi scheduling like fritzbox Stock firmware does, so that the using of the button would override the schedule? Then it will be very convenient: even if I forget to turn it off, it will be off at some point, then will be on and off according to the schedule. And I can turn it on when I need, without fetching my USB dongle. That would be ideal.

I would appreciate your hints!

Depends on the script triggered by the button.
It could get the current state and toggle it.

Here is an example.

Thank you very much for your tip! Your example worked: I looked at /etc/rc.button, then there were a few things, including wps. So I copied that file elsewhere, and made another wps file as you suggested. Then the button "wps" functioned as I wished: it will enable/disable radio. The button on Fritzbox for wifi says "wlan", so I tried with the filename "wlan", and changed
"$BUTTON" = "wps" into "$BUTTON" = "wlan" , to see if it works: Then the button "wlan" functioned for enabling/disabling radio :slight_smile:
So I made a script with

uci set wireless.<wifi-iface-name>.disabled='0'
wifi reload

and another one with '1', and set them on cron schedule. I can now come in to turn wifi on with the button when I need to, after cron disabled it :slight_smile:

I wonder though, why /rc.button/ didn't have wlan file. The button was working for shutting wifi on and off, as long as the radio was enabled, I wonder how it was working that way...

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