Community discussions

MikroTik App
 
setupcat
just joined
Topic Author
Posts: 1
Joined: Thu Aug 02, 2018 2:48 pm

script to turn on and off wlan

Tue Jun 07, 2022 12:14 pm

I'm working on a script that checks every minute if the current time is between 8am and 10pm, if that's true, i enable the wlan1, if it's not, i disable it.
I know that can be made with a simple scheduler at 8am and another one at 10pm, but the problem is if the router is turned off during those hours, it wont run the scheduler.
For now i managed to make that script, the problem is it resets the connection every time it runs, the only solution i could think of is checking if the interface is already enabled before doing it again, but i haven't found any way to check for that in a script. Does anyone have any idea how to make this possible? thank you very much in advance.
 
kevinds
Long time Member
Long time Member
Posts: 650
Joined: Wed Jan 14, 2015 8:41 am

Re: script to turn on and off wlan

Thu Jun 09, 2022 7:35 pm

Could use a simple Queue on the interface that limits the speed to a really, really low number on the interface during those times.
 
kevinds
Long time Member
Long time Member
Posts: 650
Joined: Wed Jan 14, 2015 8:41 am

Re: script to turn on and off wlan

Thu Jun 09, 2022 7:37 pm

Could use a firewall rule on the interface to drop traffic during those hours..
 
pe1chl
Forum Guru
Forum Guru
Posts: 10223
Joined: Mon Jun 08, 2015 12:09 pm

Re: script to turn on and off wlan

Thu Jun 09, 2022 7:39 pm

[find where disabled] and [find where !disabled] should return the appropriate lists for use in "set" commands.
 
User avatar
chechito
Forum Guru
Forum Guru
Posts: 3005
Joined: Sun Aug 24, 2014 3:14 am
Location: Bogota Colombia
Contact:

Re: script to turn on and off wlan

Thu Jun 09, 2022 7:48 pm

another way is using
/interface wireless access-list

Who is online

Users browsing this forum: gimmo and 68 guests