0% found this document useful (0 votes)
50 views

Script Loc Mac User 2

The document contains scripts to log a user on to a hotspot, assign them an IP address, start a scheduler task, and log them off by removing the IP assignment and queue.

Uploaded by

Anto Hartanto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Script Loc Mac User 2

The document contains scripts to log a user on to a hotspot, assign them an IP address, start a scheduler task, and log them off by removing the IP assignment and queue.

Uploaded by

Anto Hartanto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

logon:

:local a $user
:local m [/ip hotspot active get [find user=$a] mac-address]
:local b [/ip hotspot active get [find user=$a] address]
:log info message=("Prueba: ;$a; ;$m; ;$b;");
:local date [/system clock get date];
:local time [/system clock get time];
:log info "";
{
:if ( [ /ip hotspot user get $user comment ] = "" ) do={
[ /ip hotspot user set $user comment=$user]
}
}
/system script add name=$user policy=read,write source="/ip hotspot ip-binding
remove [find comment=$user]\r\nip dhcp-server lease remove [find
comment=$user]\r\n/queue simple remove [/queue simple find name=$user]\r\nsystem
scheduler remove [/system scheduler find name=$user]\r\nsystem script remove
[/system script find name=$user]"
system scheduler add name=$user start-time="$time" interval=10s policy=read,write
on-event=$user
/ip hotspot ip-binding add type=bypassed mac-address=$m address=$b comment=$a

:local a $user
:local b [/ip hotspot ip-binding get [find comment=$a] address]
:local m [/ip hotspot ip-binding get [find comment=$a] mac-address]
/ip dhcp-server lease add address=$b mac-address=$m disabled=no comment=$a;

LogOut:
:local a $user
:local b [/ip hotspot ip-binding get [find comment=$a] address]
/queue simple add name="$a" target="$b" max-limit=2M/2M
/ip hotspot user remove [find comment=$a]

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy