Community discussions

MikroTik App
 
klibby
just joined
Topic Author
Posts: 10
Joined: Fri Nov 04, 2011 5:25 pm

Logout Script Stored in Memory?

Mon Jun 09, 2014 9:55 pm

Hello,

I'm putting some scripting using the hotspot profile on-login and on-logout actions to track profile usage. While testing I noticed some interesting behavior.

I noticed if I change a logout script on a profile while a user is logged in using that profile, the change does not affect the currently logged in user. Example process below:

1) Create user profile with on-logout script (:log warn "test123")
2) Login to hotspot with that profile
3) Change on-logout script to (:log warn "test456")
4) logout of hotspot

What gets printed to the log is "test123" NOT "test456". This in itself is not an issue, but does this mean that for each user that logs in, that script is being stored in memory on the routerboard? I ask because I want to make sure I am considering resources when building this script that may have 3k+ users logged in. So if it's stored in memory, that would mean multiplying that script 3k+ times to memory rather than just processing the same script each time a user logs out.

Also, what might make this a moot point, is there a way to grab the profile name (or ID) a user logged in with from the active users list? I have come up with a way indirectly (grab username from active list, find matching user under /ip hotspot users, grab profile name assigned to user) but that seems a little messy to me.