Boys, you still focus on entities treated as “numbers”. What if the version includes “betaNN” or “rcNN”?
You could use my function “VersionToNum”, which should cover all cases:
https://git.eworm.de/cgit/routeros-scripts/tree/global-functions.rsc#n1630
Our deployment scripts are only concerned with production devices, so having beta or release candidates is not something we check for.
Thanks @eworm
Here’s the one we use
# Convert version string to number
:global doversion do={
:local coeff 100000
:local result 0
:for i from=0 to=([:len $string] -1) do={
:set $val [:pick $string $i]
:if ($val != ".") do={
:set $result ($result + ($coeff * [:tonum $val]))
:if ($coeff >= 1) do={:set $coeff ($coeff / 10)}
}
}
:return $result
}
Hotspot Login Script
:log warning [:tonum $address];
This is not working
:log warning [:tonum 10.10.10.10];
This is working
RouterOS 7.18.2