Community discussions

MikroTik App
 
User avatar
alzeno
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 54
Joined: Thu Jul 14, 2011 11:01 am

Hotspot user inactive time

Sun Jul 31, 2011 2:27 pm

Hi, how can i disable or inactive a hotspot user account for a period of time like 3 hours. After that the user will be enabled automatically too. Any script ideas to do that plz?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Hotspot user inactive time

Sun Jul 31, 2011 4:44 pm

:local username "theNameOfTheAccount";
/ip hotspot active { remove [find user="$username"] };
/ip hotspot user { disable [find name="$username"] };
Replace the variable values, schedule that to run. Schedule the below to run three hours later:
:local username "theNameOfTheAccount";
/ip hotspot user { enable [find name="$username"] };
 
User avatar
alzeno
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 54
Joined: Thu Jul 14, 2011 11:01 am

Re: Hotspot user inactive time

Mon Aug 01, 2011 12:33 pm

Thanks alot, that was very usefull for me, but i also discovered another way but by using profile, that is usefull for using more than one user.

/ip hotspot user disable [find profile="prof1"]
:foreach i in=[/ip hotspot user find disabled=yes] do={/ip hotspot active remove [find user=[/ip hotspot user get $i name]]}

Interval=3H
/ip hotspot user disable [find profile="200k"]
:foreach i in=[/ip hotspot user find disabled=yes]}

Thanks again
 
AbSSoLuT
just joined
Posts: 7
Joined: Sun May 29, 2011 6:34 pm

Re: Hotspot user inactive time

Thu Sep 22, 2011 8:50 pm

I cant understeand this!
Plz make for me more simple because i need this
Sry for my bad english

Who is online

Users browsing this forum: txfz and 43 guests