Hi all
I had a script running in Usermanager 4 that could change the rate limits if a user used more than a 40 Gigs amount of data in a month.
I have in the mean while upgraded my usermanager router to routeros v5.21
This script does not work in usermanager 5.21 any more
I have tried making corrections to the syntax but it doesn't work
{
:local user
:local surname
:local bytesin
:local bytesout
:local bytestotal
:local megstotal
:local profilename
/tool user-manager user
:foreach i in=[find customer="admin"] do={
:set user [get $i first-name]
:set surname [get $i last-name]
:set bytesin [get $i download-used]
:set bytesout [get $i upload-used]
:set bytestotal ($bytesin + $bytesout)
:set megstotal ($bytestotal / 1000000)
:set profilename [get $i actual-profile]
:if (($megstotal > 40000) && ($profilename= "1.5 M Uncapped")) do={
/tool user-manager profile limitation set [find name="$user"] Rate-limit="192k/192k 192k/288k 96k/144k 60/60 0 "
:log info "User Rate Limit set to 192k/192k 192k/288k 96k/144k 60/60 0 "
:log info $user
:log info $profilename
:log info $megstotal}
}
}
Any help will be appreciated to get it working