Delete expired accounts in the Mikrotik Hotspot system Delete users automatically

5.0/5 Votes: 1
Report this app

Describe

Delete expired accounts in the Mikrotik hotspot system

Hotspot in Mikrotik and the trouble of deleting users (users or cards)

The solution is easy. The scanning will be done automatically. All you have to do is put this script with the appropriate modifications

Roll deleting expired accounts

{
:local time 2h;
:foreach i in=[/ip hotspot user find where uptime=$time and limit-uptime=$time] do={
:local ahmedalimi [/ip hotspot user remove $i];
}
}

Just change The 2h For the time you specified for the ministers All accounts expired according to this used time will be automatically deleted.

Delete accounts roll has finished downloading

{
:local mega 100;
:local byte 1048576;
:local bytes ($byte*$mega);
:foreach i in=[/ip hotspot user find where bytes-out=$bytes and limit-bytes-out=$bytes] do={
:local ahmedalimi [/ip hotspot user remove $i];
}
}

Just change The 100 to me The amount of download that you specified for the servers All accounts expired according to this value used will be automatically deleted.

Delete accounts completed download + upload roll | Total amount of data limit-bytes-total

{
:local mega 100;
:local byte 1048576;
:local bytes ($byte*$mega);
:foreach i in=[/ip hotspot user find] do={
:local out [/ip hotspot user get $i bytes-out];
:local in [ /ip hotspot user get $i bytes-in];
:local total ($out+$in);
:if ( $total = $bytes ) do={
/ip hotspot user remove $i;
}
}
}

Just change The 100 to me The amount of downloading and uploading that you specified for the servers All accounts expired according to this value used will be automatically deleted.

Leave a comment

Your e-mail address will not be published or shared anywhere. Required fields are indicated with *