diff options
author | Christian Hesse <mail@eworm.de> | 2022-05-10 14:45:58 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-05-11 13:48:27 +0200 |
commit | 4837b4747ebb26e9abef80c5ecc01697cb1b2f90 (patch) | |
tree | 0e7950aa6014d03c930135fef629bf677daca770 /check-routeros-update | |
parent | 602933baec637cd89ccb15d0bd2471e5e9398ef2 (diff) |
check-routeros-update: RouterOS v7 path syntax
Diffstat (limited to 'check-routeros-update')
-rw-r--r-- | check-routeros-update | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/check-routeros-update b/check-routeros-update index 8cad07a..3d4f14a 100644 --- a/check-routeros-update +++ b/check-routeros-update @@ -27,10 +27,10 @@ :global WaitFullyConnected; :local DoUpdate do={ - :if ([ :len [ / system script find where name="packages-update" ] ] > 0) do={ - / system script run packages-update; + :if ([ :len [ /system/script/find where name="packages-update" ] ] > 0) do={ + /system/script/run packages-update; } else={ - / system package update install without-paging; + /system/package/update/install without-paging; } :error "Waiting for system to reboot."; } @@ -39,21 +39,21 @@ $ScriptLock $0; $WaitFullyConnected; -:if ([ :len [ / system package find where name="wireless" disabled=no ] ] > 0) do={ - :if ([ / interface wireless cap get enabled ] = true && \ - [ / caps-man manager get enabled ] = false && \ +:if ([ :len [ /system/package/find where name="wireless" disabled=no ] ] > 0) do={ + :if ([ /interface/wireless/cap/get enabled ] = true && \ + [ /caps-man/manager/get enabled ] = false && \ $SafeUpdateOnCap != true) do={ $LogPrintExit2 error $0 ("System is managed by CAPsMAN, not checking for RouterOS version.") true; } } -:if ([ :len [ / system scheduler find where name="reboot-for-update" ] ] > 0) do={ +:if ([ :len [ /system/scheduler/find where name="reboot-for-update" ] ] > 0) do={ :error "A reboot for update is already scheduled."; } $LogPrintExit2 debug $0 ("Checking for updates...") false; -/ system package update check-for-updates without-paging as-value; -:local Update [ / system package update get ]; +/system/package/update/check-for-updates without-paging as-value; +:local Update [ /system/package/update/get ]; :if ([ :len ($Update->"latest-version") ] = 0) do={ $LogPrintExit2 info $0 ("An empty string is not a valid version.") true; @@ -77,7 +77,7 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false; $DoUpdate; } - :if ($SafeUpdateNeighbor = true && [ :len [ / ip neighbor find where \ + :if ($SafeUpdateNeighbor = true && [ :len [ /ip/neighbor/find where \ version=($Update->"latest-version" . " (" . $Update->"channel" . ")") ] ] > 0) do={ $LogPrintExit2 info $0 ("Seen a neighbor running version " . $Update->"latest-version" . ", updating...") false; $SendNotification2 ({ origin=$0; \ @@ -90,7 +90,7 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false; :if ([ :len $SafeUpdateUrl ] > 0) do={ :local Result; :do { - :set Result [ / tool fetch check-certificate=yes-without-crl \ + :set Result [ /tool/fetch check-certificate=yes-without-crl \ ($SafeUpdateUrl . $Update->"channel" . "?installed=" . $Update->"installed-version" . \ "&latest=" . $Update->"latest-version") output=user as-value ]; } on-error={ @@ -108,7 +108,7 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false; :if ([ $ScriptFromTerminal $0 ] = true) do={ :put ("Do you want to install RouterOS version " . $Update->"latest-version" . "? [y/N]"); - :if (([ / terminal inkey timeout=60 ] % 32) = 25) do={ + :if (([ /terminal/inkey timeout=60 ] % 32) = 25) do={ $DoUpdate; } else={ :put "Canceled..."; |