Community discussions

MikroTik App
 
moh222222
just joined
Topic Author
Posts: 1
Joined: Thu Jul 25, 2024 10:52 am

remove users hotspot uptime 6h

Thu Jul 25, 2024 11:12 am

I want to do something through which the hotspot users will be automatically deleted for a profile named (aa), This profile is six hours session-time and a picture of its details is attached below, When creating the user, choose the profile (aa) and set it to the limit-uptime=06:00:00 :

-first: I want to delete the users hotspots for this profile, which have a total of six hours of connection to the server. Delete them, regardless of the number of times I log in and log out (as soon as it happens that he was online for six hours
-second: I want to do something so that from the first time he enters the user, he writes down the username and password, so that he maintains his connection without re-logging in again if he disconnects from the Internet or something similar (so that it is not more than two days).

dont use user-manager because have problem install ,, use hotspot users
You do not have the required permissions to view the files attached to this post.
 
FRANKMUNOZAPURE
just joined
Posts: 21
Joined: Thu May 23, 2024 11:57 am

Re: remove users hotspot uptime 6h

Thu Jul 25, 2024 7:16 pm

Hello, I hope this helps you:
:local comment "IN USE"
:local userprofile [ip hotspot user get [find where name="$user"] profile]

:if ([/ip hotspot user get $user comment]="") do={[/ip hotspot user set $user comment=$comment]}

[/system scheduler 
add comment= [/ip hotspot user profile get [find where name="$userprofile"] name] name=$user on-event="/ip hotspot user remove \"$user\" \r\
  \n/system scheduler remove [find where name=\"$user\"] \r\
  \n\r\
" interval= [/ip hotspot user profile get [find where name="$userprofile"] session-timeout]]

Paste it in the script tab of the user profiles.