Mon Feb 08, 2021 6:17 am
For the moment you can kinda-sorta get away with it by storing variables as comments. The layer7-protocol area is not a bad one because it is practically unused these days so it doesn't clutter up the interface if you put a bunch of variables in there
Comments will not store arrays correctly, or rather the 'toarray' command to convert a string back to an array doesn't work because arrays store with semi-colon separates. Whereas the 'toarray' command uses commas to separate them (why mikrotik why?)
But this method works just fine for simpler things. I use it for incrementing a counter in a few scripts. One of them being a template that runs at a later time, where say a router is told to change some config and then reboot. Well the first command is to increment an integer in the comment of that scheduled task, it's first read and if the counter is higher than say 1 then something has gone wrong, commands havn't executed properly, script has failed, it failed to self-delete (otherwise its just going to reboot every single day at 3am forever) etc so it'll then send an email to support desk as well as a remote syslog message to alert that somethings not right and requires manual intervention