Hapus atau disable untuk user Hotspot yang telah expired menggunakan schedule
User mikrotik yang telah melewati masa aktip akan terus menerus bisa login, cara mengatasinya tambahkan script berikut di profile hotspot.
1. Masuk ke hotspot, cari tab "user profile", pilih profile yang akan dikonfigurasikan
2. Setelah profile aktip, cari tab script dan tambahkan script berikut :
:local pengguna $user;
:local date [/system clock get date];
:local time [/system clock get time];
:log warning "$pengguna telah login pada jam $time";
{
#tambahkan comment tanggal login pertama kali
:if ( [ /ip hotspot user get $pengguna comment ] = "" ) do={
[ /ip hotspot user set $pengguna comment=$date ]
}
#tambahkan di schedule sesuai masa aktip
#hapus di schedule bila masa aktip selesai
:if ([/system scheduler find name=$pengguna]="") do={
/system scheduler add name=$pengguna interval=30d on-event="/ip hotspot user disable [find name=$pengguna]\r\n/ip hotspot active remove [find name=$pengguna]\r\n/system scheduler remove [find name=$pengguna]"
}
}
Catatan :
Ganti interval=30d sesuai keperluan anda, misalnya 1d untuk 1 hari
Comments