Re: Automating MikroTik RouterOS updates
Posted: Fri Jun 17, 2022 7:12 pm
I started using Unimus from version 2.2.2 one week ago and skipped 2.2.3 beta.
A discussion forum for Unimus
https://forum.unimus.net/
We just released 2.2.4, which should contain the final fix for these variable prefixing issues. Please let us know if all your Tik scripts work properly now without needing to be escaped with "\".
Code: Select all
:set PkgVer "$[/system package get routeros version]"
Code: Select all
:set RbVer "$[/system routerboard get current-firmware]"
Code: Select all
:set PkgVer \"\$[/system package get routeros version]
Code: Select all
:set PkgVer "$[/system package get routeros version]"
Code: Select all
:set PkgVer "7.4"
Anything in the $[...] format will need the $ escaped due to a "clash" with Unimus behavior modifier formatting:ementat wrote: ↑Tue Jul 26, 2022 7:41 amHi Tomas,
On version 2.2.4 I don't need to double-escape all "$", but when I am using something like this:
orCode: Select all
:set PkgVer "$[/system package get routeros version]"
I need to double-escape "$" or the code inside [] will be executed during the config push and I am getting the expression result in script code, not the expression itself. I don't think this is the expected behavior, right? ...Code: Select all
:set RbVer "$[/system routerboard get current-firmware]"
Thanks for linking Unimus wiki. I just want to clarify for myself: both wiki examples are escaping $. I got the idea about control sequence and variables. But in my example i need to DOUBLE escape $ like this:
Code: Select all
:set PkgVer \"\\$[/system package get routeros version]\"
Code: Select all
:set PkgVer \"\$[/system package get routeros version]\"
Code: Select all
:set PkgVer "$[/system package get routeros version]"