Script for reboot based on wireless clients

Needs a script to reboot a Omnitik when registered clients = 0 on wlan interfaces e ou virtual ssid´s.
Thanks in advance

And what? I see easier to check the interface status as the interface doesn’t report running state when no clients connected. It’s quite similar. So what problem do you have with your script?

Dude of no one replies send me a mail ill write it for you when i have some time you can then come post it here werner.venter.mail@gmail.com.


Sent from my iPhone using Tapatalk

:local clientes [/interface wireless registration-table print count-only];
:local WarnAt 0

#:log info ($clientes);

:if ($clientes <= $WarnAt) do={
#:log info ($clientes);
/system reboot
}

But what happens on reboot > before clients can register script runs and reboot again > on reboot >repeat loop

Put in a delay of say 5mins on the scheduler after router reboots to allow for clients to register before script becomes active ?

Why you need to Reboot?
what is problem?

All clients are disconected and not concect anymore.

What do you see in the omnitiks log file when the clients drop?

many thanks :slight_smile:

Great but how i can make it reboot when
there are 0 active users in the hotspot ?

i tried to do some adjustments but it didn’t work firstly ,
second i don’t have a good skills in programming :slight_smile:

this is how i made my adjustments


:local clientes [/ip hotspot active-table print count-only];
:local WarnAt 1

#:log info ($clientes);

:if ($clientes <= $WarnAt) do={
#:log info ($clientes);
/system reboot
}

i want to make the mt reboot when the active users reaches 0
i think i have a mistake in the first lane :slight_smile: but i don’t how i can correct it

Thx, <3

Oh, never mind :slight_smile:

my problem was actually in the first line :slight_smile:

i edited it
from
:local clientes [/ip hotspot active-table print count-only];
to
:local clientes [/ip hotspot active-table print count-only];

and do i have to run this script after every reboot or it will still running ?