View difference between Paste ID: h5TXnLFg and yL0uPj96
SHOW: | | - or go back to the newest paste.
1
{
2
:local usernya $user;
3
:local resetnya "reset-counter-$usernya";
4
:if ([/ip hotspot user find name=$usernya limit-bytes-total=1073741824]="") do={/ip hotspot user set [find name=$usernya] limit-bytes-total=1073741824};
5
:if ([/system schedule find name=$resetnya]="") do={
6
/system schedule add name=$resetnya start-time=00:00:01 interval=1d on-event="/ip hotspot user reset-counter [find name=$usernya]"
7
}
8
:if ([/system schedule find name=$usernya]="") do={
9
/system schedule add name=$usernya interval=30d on-event="/ip hotspot user remove [find name=$usernya]\r\n/ip hotspot active remove [find user=$usernya]\r\n/system schedule remove [find name=$resetnya]\r\n/system schedule remove [find name=$usernya]"
10
}
11
}