Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Delete Unli Time #171

Open
MeeeMaaaaw opened this issue Jul 16, 2024 · 0 comments
Open

Auto Delete Unli Time #171

MeeeMaaaaw opened this issue Jul 16, 2024 · 0 comments

Comments

@MeeeMaaaaw
Copy link

MeeeMaaaaw commented Jul 16, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant