Page 1 of 1

Script for reboot based on wireless clients

Posted: Mon Jun 22, 2015 8:54 pm
by Niex
Needs a script to reboot a Omnitik when registered clients = 0 on wlan interfaces e ou virtual ssid´s.
Thanks in advance

Script for reboot based on wireless clients

Posted: Tue Jun 23, 2015 3:35 pm
by jarda
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?

Script for reboot based on wireless clients

Posted: Tue Jun 23, 2015 6:49 pm
by wcsnet
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

Re: Script for reboot based on wireless clients

Posted: Fri Oct 02, 2015 11:30 pm
by Niex
:local clientes [/interface wireless registration-table print count-only];
:local WarnAt 0

#:log info ($clientes);

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

Re: Script for reboot based on wireless clients

Posted: Sat Oct 03, 2015 4:21 pm
by n21roadie
: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 ?

Re: Script for reboot based on wireless clients

Posted: Sat Oct 03, 2015 9:08 pm
by mousa1983
Why you need to Reboot?
what is problem?

Re: Script for reboot based on wireless clients

Posted: Wed Dec 09, 2015 2:49 pm
by Niex
All clients are disconected and not concect anymore.

Re: Script for reboot based on wireless clients

Posted: Tue Jan 05, 2016 3:29 pm
by p3rad0x
What do you see in the omnitiks log file when the clients drop?

Re: Script for reboot based on wireless clients

Posted: Mon May 23, 2016 10:04 pm
by NetHorror
:local clientes [/interface wireless registration-table print count-only];
:local WarnAt 0

#:log info ($clientes);

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

Re: Script for reboot based on wireless clients

Posted: Tue Aug 09, 2016 9:30 am
by a7mad78
: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 ?
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 :)

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 :) but i don't how i can correct it

Thx,, <3

Re: Script for reboot based on wireless clients

Posted: Tue Aug 09, 2016 9:35 am
by a7mad78
Oh, never mind :)

my problem was actually in the first line :)

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 ?