diff options
author | Christian Hesse <mail@eworm.de> | 2022-05-12 11:04:43 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-05-12 11:04:43 +0200 |
commit | df547b87a47e279d3f6b744675821621eea5d7b8 (patch) | |
tree | d5b33fb62e10637d70d8d0616437294ceb15ed9f /firmware-upgrade-reboot | |
parent | 93ec9afe558ef6eba5d513fab359bb5f6618666d (diff) | |
parent | 12655bd58afc3a75fe3e2958bbe130b96f8b9be7 (diff) |
Merge branch 'ros-v7-path-syntax' into next
Diffstat (limited to 'firmware-upgrade-reboot')
-rw-r--r-- | firmware-upgrade-reboot | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware-upgrade-reboot b/firmware-upgrade-reboot index ac2cb55..27bbe41 100644 --- a/firmware-upgrade-reboot +++ b/firmware-upgrade-reboot @@ -13,7 +13,7 @@ :global LogPrintExit2; :global VersionToNum; -:local RouterBoard [ / system routerboard get ]; +:local RouterBoard [ /system/routerboard/get ]; :if ($RouterBoard->"current-firmware" = $RouterBoard->"upgrade-firmware") do={ $LogPrintExit2 info $0 ("Firmware is already up to date.") true; } @@ -21,21 +21,21 @@ $LogPrintExit2 info $0 ("Different firmware version is available, but it is a downgrade. Ignoring.") true; } -:if ([ / system routerboard settings get auto-upgrade ] = false) do={ +:if ([ /system/routerboard/settings/get auto-upgrade ] = false) do={ $LogPrintExit2 info $0 ("Firmware version " . $RouterBoard->"upgrade-firmware" . \ " is available, upgrading.") false; - / system routerboard upgrade; + /system/routerboard/upgrade; } -:while ([ :len [ / log find where topics=({"system";"info";"critical"}) \ +:while ([ :len [ /log/find where topics=({"system";"info";"critical"}) \ message="Firmware upgraded successfully, please reboot for changes to take effect!" ] ] = 0) do={ :delay 1s; } -:local Uptime [ / system resource get uptime ]; +:local Uptime [ /system/resource/get uptime ]; :if ($Uptime < 1m) do={ :delay $Uptime; } $LogPrintExit2 info $0 ("Firmware upgrade successful, rebooting.") false; -/ system reboot; +/system/reboot; |