Hi
Can you help me with script that save/read variable beacause after reboot i loss counter ![]()
My Mikrotik is a HotSpot and I must read from it a some statistic's like a number of the currently logged-in users and count of the total number of logins.
I do this by this script:
#total logins
:global counter
:set counter ($counter + 1)
/system script environment print file=licznik.txt
it's put in ip->hotspot->user profile->scripts->on login
I try save variable to file by this line "/system script environment print file=licznik.txt" but this create something like that:
jun/17/2016 12: 0:11 by RouterOS 6.35.4
software id =
name: counter
value: 3
I Try read content of file licznik.txt by
:global counter
:set counter [/file get licz.txt content];
but this lines creat variable counter with all other text that is in file licznik.txt
Can you help me with my idea or maby You have beter solution for this ?