You are on page 1of 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