Community discussions

MikroTik App
 
murdinger
just joined
Topic Author
Posts: 1
Joined: Thu Nov 24, 2022 2:48 am

Hotspot Script Active User Problem

Thu Nov 24, 2022 2:55 am

Hello, since i cant make work out the script that i found on the forum, i am asking for help.
Im using FreeRadius and i have to guarantee only one simultaneous user in Hotspot Active Users with a script that runs every minute on the router.
My RB1100 is using RouterOS V7

Scipt:
:local uname $user;
:local usercount 0;
:local usertime "00:00:00";
:local kickable;
:local maxuser 1;

:foreach i in=[/ip hotspot active find user=$uname] do= {
  :local curup [/ip hotspot active get $i uptime];
  :if ( $curup > $usertime ) do={
        :set usertime $curup
        :set kickable $i
   }
  :set usercount ($usercount+1)
}
:if ($usercount >= $maxuser) do={
  :log info "Login user: $uname ($usercount/$maxuser) - Oldest $usertime will be logout!"
  /ip hotspot active remove numbers=$kickable
} else {
   :log info "Login user: $uname ($usercount/$maxuser)"
}
 
binooetomo
just joined
Posts: 17
Joined: Sat Nov 12, 2016 7:08 am

Re: Hotspot Script Active User Problem

Sat Mar 11, 2023 9:59 am

Did you solve the problem?
Hello, since i cant make work out the script that i found on the forum, i am asking for help.
Im using FreeRadius and i have to guarantee only one simultaneous user in Hotspot Active Users with a script that runs every minute on the router.
My RB1100 is using RouterOS V7

what FreeRadius module you used?
Basicaly, your FreeRadius have to include 'reply:Port-Limit' in it's response to the radius client.

reff: https://wiki.mikrotik.com/wiki/Manual:R ... ess-Accept'

-bino-

Who is online

Users browsing this forum: No registered users and 17 guests