0% found this document useful (0 votes)
72 views1 page

Onlogout Script

The script is designed to handle user logout in a hotspot environment. It removes the user from the hotspot and deletes their associated data file if their uptime exceeds the limit. The script also formats the MAC address by removing colons for file naming purposes.

Uploaded by

banimohaymin
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)
72 views1 page

Onlogout Script

The script is designed to handle user logout in a hotspot environment. It removes the user from the hotspot and deletes their associated data file if their uptime exceeds the limit. The script also formats the MAC address by removing colons for file naming purposes.

Uploaded by

banimohaymin
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

### onlogout script

### hotspot folder for HEX put flash/hotspot for haplite put hotspot only
:local hotspotFolder "flash/hotspot";

:local mac $"mac-address";


:local macNoCol;
:for i from=0 to=([:len $mac] - 1) do={
:local char [:pick $mac $i]
:if ($char = ":") do={
:set $char ""
}
:set macNoCol ($macNoCol . $char)
}

:if ([/ip hotspot user get [/ip hotspot user find where name="$user"] limit-uptime]
<= [/ip hotspot user get [/ip hotspot user find where name="$user"] uptime]) do={
/ip hotspot user remove $user;
/file remove "$hotspotFolder/data/$[Link]";
/system sche remove [find name=$user];
}

You might also like