Wifi scheduling in openwrt

i need to schedule a specific wireless ssid to turn on and off at a specific time. i just want only one ssid under radio0 to turn on and off not affecting other ssid.
if it can be done my first preference will be luci and 2nd will be through terminal.
Thank you all of you......


you have LuCI app

and some useful discussion here

@NPeca75 this luci app doesnt allow a specific ssid to turn off or on as i can see here its allowing to shutdown all the radios

Cron job would get the job done. I need to review the syntax, but I believe the command is something like wifiup or wifidown

well, some quick & dirty script example


ID=$(uci show wireless|grep "'$SSID'"|cut -d'.' -f2)
if [ ! -z "$ID" ]; then
    uci set wireless.${ID}.disabled=0
    uci commit wireless
    wifi reload

and disabled=1 for turn off

you need to create two script, one with disabled=0, other with disabled=1
and put them in cron

for ex:

10 20 * * *  /root/wifi_off
10 05 * * *  /root/wifi_on

only drawback of this simple script that it will work only if you have 1 unique SSID
so, if you have "wifi-guest" on 2.4 and 5GHz, it will fail

where should i implement this?please guide me not familiar will terminal thankyou for your time.
my wireless configuration is like this can u write a script according to this. the one that i want to schedule is named "sonam".


then you will find SSID definition in script and replace
with desired SSID

please see my post above

so i just need to put ur script in the root file ri8 and then reboot


i don't want to offend you but according to your question, it is clear that you have very low experience with linux / shell

i will try to explain once more

you need 2 script
one with disabled=0, name it /root/wifi_on
one with disabled=1, name it /root/wifi_off
then make two script executable
and then put links to two script in crontab, as in example

1 Like

its fine u can call me anything bcz i m still learning one day ill also be good like u

when you put two script in /root/
then try to run them by hand over SSH to test them
if they work when you run them manually, then you could edit your crontab

thank for your help means a lot

No need for any script.

Set 2 cron entries. One for on
/sbin/wifi up # set the up time
and another entry for off
/sbin/wifi down # set the
down time

Here is a nice cron tab generator

hi @RuralRoots

@Rabi need to disable only ONE SSID, not the whole radio (wifi)

1 Like

I stand corrected. But still relevant based on the topic title.

1 Like

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