Pemirsa, kali ini ada script untuk membuat limit harian 1GB dan setelah 30 hari akan diskonek pada hotspot mikrotik.
=== kuota 1GB per hari, expired 30 hari ===
on login script :
{
:local usernya $user;
:if ([/ip hotspot user find name=$usernya limit-bytes-total=1000000]="") do={/ip hotspot user set [find name=$usernya] limit-bytes-total=1000000};
:if ([/system schedule find name=$usernya]="") do={
/system schedule add name=$usernya interval=30d on-event="/ip hotspot user disable [find name=$usernya]\r\n/ip hotspot active remove [find user=$usernya]\r\n/system schedule remove [find name=$usernya-reset-counter]\r\n/system schedule remove [find name=$usernya]"
}
:if ([/system schedule find name="$usernya-reset-counter"]="") do={
/system schedule add name="$usernya-reset-counter" interval=1d on-event="/ip hotspot user reset-counter [find name=$usernya]"
}
}
Script diatas tambahkan pada hotspot on login script
Semoga bermanfaat.
=== kuota 1GB per hari, expired 30 hari ===
on login script :
{
:local usernya $user;
:if ([/ip hotspot user find name=$usernya limit-bytes-total=1000000]="") do={/ip hotspot user set [find name=$usernya] limit-bytes-total=1000000};
:if ([/system schedule find name=$usernya]="") do={
/system schedule add name=$usernya interval=30d on-event="/ip hotspot user disable [find name=$usernya]\r\n/ip hotspot active remove [find user=$usernya]\r\n/system schedule remove [find name=$usernya-reset-counter]\r\n/system schedule remove [find name=$usernya]"
}
:if ([/system schedule find name="$usernya-reset-counter"]="") do={
/system schedule add name="$usernya-reset-counter" interval=1d on-event="/ip hotspot user reset-counter [find name=$usernya]"
}
}
Script diatas tambahkan pada hotspot on login script
Semoga bermanfaat.
1 komentar:
yuhuu....bermanfaat sekali
Isolasi hp double tape
Post a Comment