Community discussions

MikroTik App
 
User avatar
m3das
just joined
Topic Author
Posts: 14
Joined: Thu Feb 23, 2023 6:10 pm

Improve my script

Sun Apr 02, 2023 8:37 pm

Hello, everyone seems that I am not satisfied with my script.
This script works, need help if anyone can improve it?
:local un "user1"
/ip hotspot user set limit-uptime=0s [find where name=$un] 
/ip hotspot user set comment="" [find where name=$un]
/ip hotspot user reset-counters [find where name=$un]
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Improve my script

Sun Apr 02, 2023 9:40 pm

But if you don't explain what you want to do, what do you want to be told?
 
User avatar
m3das
just joined
Topic Author
Posts: 14
Joined: Thu Feb 23, 2023 6:10 pm

Re: Improve my script

Mon Apr 03, 2023 7:37 am

But if you don't explain what you want to do, what do you want to be told?
Hi sir extended,

Thank you for the replay,

The user has a monthly validity profile when the user goes beyond validation the user will disconnect from the hotspot. In order to renew/extend the validity of users, I need to clear the user's session in order to log back in. So I made a script for every user to renew their validity.
 
User avatar
m3das
just joined
Topic Author
Posts: 14
Joined: Thu Feb 23, 2023 6:10 pm

Re: Improve my script

Mon Apr 03, 2023 8:10 am

But if you don't explain what you want to do, what do you want to be told?
or making the script shorter or in one line with the same function.

Who is online

Users browsing this forum: No registered users and 12 guests