@rextended this is a great script!
It will probably help-me to solve the problem I’m trying to solve.
Thanks!
But… (There is always a but, ha-ha.)
To be sincere, I do not like very much the idea of subverting the use of a field of a specific resource like was done with layer7 firewall rules.
I Understand that it was what the best that could be done whit the resources that were available at that time…
But I feel that Layer7 Firewall Rules could be removed sometime, and then this script would be orphaned.
Last interaction on this thread was Wed Aug 30, 2023 4:37 am
But 4 months later the Json serialize and deserialized resources were added:
with the first documentation of for those resources being published in Scripting - RouterOS - MikroTik Documentation - v. 54 dez. 07, 2023 13:21
I tend to believe that Json support will not be removed… Several “new” features have resources based on it like REST-API, MQTT/IOT/GPIO.
Considering that, I was wondering to use that Json structure to persist the environment variables.
The second part of my ideia was to use /system/script as the persistence method for a json file.
Why /system/script?
In my opinion saving it on a script is the easiest way to persist a text-based file on an editable way and contained in the backup.rsc and not on another extra file.
I will start to think of a way to do that.
Please alert me if I’m trying to reinvent the wheel…
Any help is welcome.