JuanFi
JuanFi copied to clipboard
Auto Delete Unli Time
Good Day,
Sharing new Scripts to delete users with unlimited time automatically. Please insert the script below on your onLogin script. It works with default Juanfi Portal, please make changes if you need to. Tested and works with ros6.49 and above
`### enable Delete Unli Time :local isDeleteUnli 1;
####Auto Delete UNLI TIME :local cuptime [/ip hotspot user get $user uptime]; :local climituptime [/ip hotspot user get $user limit-uptime];
:if ($isDeleteUnli=1) do={
:if ( $climituptime < $cuptime) do={
/log warning message="adding script to remove $user due to unli time";
/system scheduler add name="$user-remove" interval=5
policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
on-event=("/ip hotspot user remove [find name=$user];\r\n".
"/ip hotspot active remove [find user=$user];\r\n".
"/ip hotspot cookie remove [find user=$user];\r\n".
"/system scheduler remove [find name=$user-remove];\r\n")
/log warning message="EO Script";
}
}`
This script will delete your admin/operator user voucher with no time limit, please make another user profile for such users.
Your input is appreciated.