mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
firmware-upgrade-reboot: RouterOS v7 path syntax
This commit is contained in:
parent
f5f41a8aa7
commit
294aff9c02
1 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue