What i want???... a counter of hotspot logins (simple scritpt), really simple (extracted from another post)
Into on-login section of user profile script of hotspot:
Code: Select all
/system script run contarusuario;
Code: Select all
:global usuarios;
:set usuarios ($usuarios + 1);
:log info "number of HS logins: $usuarios"
1º. If i execute the script manually (into script sections)... the result is as wanted, the variable "usuarios" increase... and can see their values into "environment" sections of scripts.
2º. If i execute manually (into terminal window)... same result, all is ok
3º. But if is executed with hotspot login...
a. Value is always "1", no matter how many logins, and logoff we did, even with two users online, value show to terminal is "1"
b. The variable is not shown into "environment section".
c. Even more... if i execute several times manually the script, i can see the variable increasing... 5,6,7... if i do a login into hotspot.... "1"... but "global" variable remain as previous 7,8,9
Conclusions...
1º. The scripts is executed on login... (as result is showed into terminal).
2º. But the variable created is not global, but local... and afther the job is done, their result is deleted, so results are useless.
How can i solve this trouble?????