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

Script Membuat Validity User

This document contains three versions of scripts for automatically removing Mikrotik hotspot users. Version 1 sets a user comment if empty and adds a script to remove the user and related entities after a set time interval. Version 2 adds user profiles for blocking or removing a user after the interval. Version 3 adds a scheduler to automatically delete users after a set duration. It also provides an explanation of the scheduler settings. The last part shows how to delete users when their quota is exceeded based on bytes in, out or total.

Uploaded by

Anto Hartanto
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)
507 views1 page

Script Membuat Validity User

This document contains three versions of scripts for automatically removing Mikrotik hotspot users. Version 1 sets a user comment if empty and adds a script to remove the user and related entities after a set time interval. Version 2 adds user profiles for blocking or removing a user after the interval. Version 3 adds a scheduler to automatically delete users after a set duration. It also provides an explanation of the scheduler settings. The last part shows how to delete users when their quota is exceeded based on bytes in, out or total.

Uploaded by

Anto Hartanto
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

VERSI 1

:local date [/system clock get date];


:local time [/system clock get time];
:log info "";
{
:if ( [ /ip hotspot user get $user comment ] = "" ) do={
[ /ip hotspot user set $user comment=$user]
}
}
/system script add name=$user policy=read,write source="/ip hotspot user remove
[find comment=$user]\r\nip hotspot active remove [/ip hotspot active find
user=$user]\r\nsystem scheduler remove $user\r\nsystem script remove $user"
system scheduler add name=$user start-time="$time" interval=1d policy=read,write
on-event=$user

VERSI 2
DI ISI DI USER PROFIL
/system scheduler add name="remove-user-$user"interval=1d on-even="/ip hotspot
active remove [find user=$user] ; /ip hotspot user set$user profil=BLOKIR; system
scheduler remove [find name=remove-user-$user]"
DI ISI DI PROFIL BLOKIR
/system scheduler add name="remove-blokir-$user"interval=1d on-even="/ip hotspot
active remove [find user=$user] ; /ip hotspot user remove [find name=$user]; system
scheduler remove [find name=remove-blokir-$user]"

VERSI 3 RIFAI UCIHA


AUTO DELETE USER HOTSPOT By DURATION
*******************************************
local a $user
if ([len [/system scheduler find name=$a]] = 0) do={[
/system scheduler add name=$a interval="30d 00:00:00" start-time="03:00:00" on-
event="if ([len [/ip hotspot user find name=$a]] = 1) do={[/ip hotspot user remove
[find name=$a]]}
/system scheduler remove [find name=$a]"
]}

PENJELASAN:
interval: sesuaikan berapa lama scheduler tersebut di jalankan. sebagai contoh 30d
00:00:00 yg artinya 30 hari
start-time: jam berapa scheduler di jalankan, sebagai contoh 03:00:00 yg artinya di
jalankan jam 3 pagi

AUTO DELETE USER HOTSPOT By QUOTA


*******************************************
/ip hotspot user remove [find profile="Pembeli-1Gb" bytes-in>1073740000]
/ip hotspot user remove [find profile="Pembeli-1Gb" bytes-out>1073740000]
/ip hotspot user remove [find profile="Pembeli-1Gb" bytes-total>1073740000]

PENJELASAN:
profile: akan mencari seluruh user yang nama profile nya Pembeli-1Gb
bytes-in: akan menghapus user yang byte-in nya lebih besar dari 1073740000
bytes-out: akan menghapus user yang byte-out nya lebih besar dari 1073740000
bytes-total: akan menghapus user yang byte-total nya lebih besar dari 1073740000
Silahkan sesuaikan dengan pengaturan hotspot mikrotik kalian, agar lebih jelas
silahkan simak videonya.
http://idsly.bid/wX2X

You might also like