mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-04 18:24:35 +02:00
global-functions: merge $LogAnd{Error,Put} to $LogPrintExit ...
... and fix logging. Logging with severity from variable (:log $severity ...) is not possible, this is considered a syntax error. Also the 'workaround' with parsing code failed with missing message in log. The reliable code is a lot longer, so merge the two functions to save a lot of duplicate code.
This commit is contained in:
parent
6036edb506
commit
ceaa83b83e
13 changed files with 56 additions and 56 deletions
|
@ -11,7 +11,7 @@
|
|||
:global DeviceInfo;
|
||||
:global ScriptFromTerminal;
|
||||
:global SendNotification;
|
||||
:global LogAndError;
|
||||
:global LogPrintExit;
|
||||
|
||||
:local DoUpdate do={
|
||||
:if ([ / system script print count-only where name="packages-update" ] > 0) do={
|
||||
|
@ -25,7 +25,7 @@
|
|||
:if ([ / system package print count-only where name="wireless" disabled=no ] > 0) do={
|
||||
:if ([ / interface wireless cap get enabled ] = true && \
|
||||
[ / caps-man manager get enabled ] = false) do={
|
||||
$LogAndError error "System is managed by CAPsMAN, not checking.";
|
||||
$LogPrintExit error "System is managed by CAPsMAN, not checking." true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
|||
:local Update [ / system package update get ];
|
||||
|
||||
:if ([ :len ($Update->"latest-version") ] = 0) do={
|
||||
$LogAndError warning "An empty string is not a valid version.";
|
||||
$LogPrintExit warning "An empty string is not a valid version." true;
|
||||
}
|
||||
|
||||
:if ($Update->"installed-version" != $Update->"latest-version") do={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue