mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-25 02:58:37 +02:00
capsman-rolling-upgrade: properly handle vanished cap
This commit is contained in:
parent
afc231596c
commit
ff4e5339d0
1 changed files with 6 additions and 2 deletions
|
@ -24,9 +24,13 @@ $ScriptLock $0;
|
||||||
:if ($Delay > 120) do={ :set Delay 120; }
|
:if ($Delay > 120) do={ :set Delay 120; }
|
||||||
:foreach RemoteCap in=[ / caps-man remote-cap find where version!=$InstalledVersion ] do={
|
:foreach RemoteCap in=[ / caps-man remote-cap find where version!=$InstalledVersion ] do={
|
||||||
:local RemoteCapVal [ / caps-man remote-cap get $RemoteCap ];
|
:local RemoteCapVal [ / caps-man remote-cap get $RemoteCap ];
|
||||||
$LogPrintExit2 info $0 ("Starting upgrade for " . $RemoteCapVal->"name" . \
|
:if ([ :len $RemoteCapVal ] > 1) do={
|
||||||
|
$LogPrintExit2 info $0 ("Starting upgrade for " . $RemoteCapVal->"name" . \
|
||||||
" (" . $RemoteCapVal->"identity" . ")...") false;
|
" (" . $RemoteCapVal->"identity" . ")...") false;
|
||||||
/ caps-man remote-cap upgrade [ find where name=$RemoteCapVal->"name" ];
|
/ caps-man remote-cap upgrade $RemoteCap;
|
||||||
|
} else={
|
||||||
|
$LogPrintExit2 warning $0 ("Remote CAP vanished, skipping upgrade.") false;
|
||||||
|
}
|
||||||
:delay ($Delay . "s");
|
:delay ($Delay . "s");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue