hello ,
does anyone know how can I make a script that count me the numbers of active users that using my hotspot?
every time I get a new entry (new person in start using the hotspot) the counter will get +1 , and in the end of the day I will get the number (and at the end of the day I will reset the counter)?
can it be done?
I have try to do this but without any luck so far
but this will print me the number at the current time and i will not see how many where before…
I need it for statistics.
that way I can say - yesterday were 100 people
and one week ago were 6000 people
.
if you have better way to do this - I will love to hear it
I did what you advice me to do
and this is the script I wrote:
:global counter;
:set counter ($counter+1);
:log warning "numbers of users so far is $counter";
global systemTime [/system clock get time];
global systemDate [/system clock get date];
:global hotusers "The time is - $systemDate $systemTime
Numbers of hot spot users so far-$counter";
/file set [/file find name=hotusers.txt] contents=$hotusers;
but it won’t count me
every time I get counter=1
in the hostpot on loggin script I wrote:
/system script run hotusers;(this is the name of the script above - I can see he is working ,I see the log..)
it’s work for me also
but when I disconnect from the hotspot and after an hour connect again -
I still get the number 1
even when i delete the dhcp-server and hotspot host of my device
you can see at the log and in the counter more then 1?
what kind of hotspot did you config?
I have a free one and all the people who want to connect have the same user&pass
maybe this is the problem?
its count the names of the users and not the amount?
this is what I have:
hotspot-user-profile-scripts-On login:
/system script run hotusers;
this is the hotusers script:
:global counter;
:set counter ($counter+1);
:log warning "numbers of users so far is $counter";
global systemTime [/system clock get time];
global systemDate [/system clock get date];
:global hotusers "The time is - $systemDate $systemTime
Numbers of hot spot users so far-$counter";
/file set [/file find name=hotusers.txt] contents=$hotusers;
and all I get in the Log file (and in the file ) is :
“The time is - jun/24/2012 09:50:52
Numbers of hot spot users so far-1”
and I can see that there is only 1 user at active (and I know that were 10 people connected since the lest time I did reset)