eworm-de / routeros-scripts

a collection of scripts for MikroTik RouterOS
GNU General Public License v3.0
1.27k stars 285 forks source link

[Observation] lte/firmware-upgrade: Using once causes the command to not wait for version check to complete before returning a result #69

Closed netravnen closed 3 months ago

netravnen commented 3 months ago

https://github.com/eworm-de/routeros-scripts/blob/cd4ac2c0881f92327ce173f2294b066ca4bc2ba2/unattended-lte-firmware-upgrade.rsc#L13

I think this line is causing issues in the later v7 releases...

Current behaviour in v7.15 on a RBLHGGR

[admin@RBLHGGR] > { :local Firmware [/interface/lte/firmware-upgrade lte1 once as-value]; :put $Firmware; }
.id=*2;installed=R11e-LTE6_V038;status=cheking...

Expected behaviour

[admin@RBLHGGR] > { :local Firmware [/interface/lte/firmware-upgrade lte1 as-value]; :put $Firmware; }
.id=*2;installed=R11e-LTE6_V038;latest=R11e-LTE6_V038

Example

[admin@RBLHGGR] > /system/script/run check-lte-firmware-upgrade
info: An empty string is not a valid version.

Hardware

[admin@RBLHGGR] > /system/routerboard/print 
       routerboard: yes
             model: RBLHGGR
     serial-number: ***********
     firmware-type: a3700
  factory-firmware: 6.48.3
  current-firmware: 7.13
  upgrade-firmware: 7.15

I do not know if this is a change in the way ROS behaves.

Using once causes the command to output the result immediately, instead of waiting for the check to complete.

eworm-de commented 3 months ago

Hmm, no idea why I did not catch that myself... But your change makes sense. Fixed with c2dd9de9b1789c81f2a7db14f5dbba87d5881286 (and 0a085e6610aadf546b936076f6e3ae68538b1cfa for check-lte-firmware-upgrade).