mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
packages-update: get values into array
This commit is contained in:
parent
229dc539cc
commit
3aa4d7ea50
1 changed files with 4 additions and 5 deletions
|
@ -6,17 +6,16 @@
|
||||||
|
|
||||||
:global DownloadPackage;
|
:global DownloadPackage;
|
||||||
|
|
||||||
:local InstalledVersion [ / system package update get installed-version ];
|
:local Update [ / system package update get ];
|
||||||
:local LatestVersion [ / system package update get latest-version ];
|
|
||||||
|
|
||||||
:if ($InstalledVersion = $LatestVersion) do={
|
:if ($Update->"installed-version" = $Update->"latest-version") do={
|
||||||
:log info ("Version " . $LatestVersion . " is already installed.");
|
:log info ("Version " . $Update->"latest-version" . " is already installed.");
|
||||||
:error "No updates available.";
|
:error "No updates available.";
|
||||||
}
|
}
|
||||||
|
|
||||||
:foreach Package in=[ / system package find where !bundle ] do={
|
:foreach Package in=[ / system package find where !bundle ] do={
|
||||||
:local PkgName [ / system package get $Package name ];
|
:local PkgName [ / system package get $Package name ];
|
||||||
if ([ $DownloadPackage $PkgName $LatestVersion ] = false) do={
|
if ([ $DownloadPackage $PkgName ($Update->"latest-version") ] = false) do={
|
||||||
:log error ("Download for package " . $PkgName . " failed.");
|
:log error ("Download for package " . $PkgName . " failed.");
|
||||||
:error "Error: See log for details.";
|
:error "Error: See log for details.";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue