mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-04 10:15:05 +02:00
[ ... print count-only ...] -> [ :len [ ... find ... ] ]
Using 'print count-only' always prints a number to terminal, even if the value is evaluated in a condition or assigned to a variable. This can be quite annoying. Behavior will not chance (SUP-25503), so replacing the code...
This commit is contained in:
parent
92ca31a41d
commit
ff5cdc3019
20 changed files with 38 additions and 38 deletions
|
@ -19,7 +19,7 @@
|
|||
:global VersionToNum;
|
||||
|
||||
:local DoUpdate do={
|
||||
:if ([ / system script print count-only where name="packages-update" ] > 0) do={
|
||||
:if ([ :len [ / system script find where name="packages-update" ] ] > 0) do={
|
||||
/ system script run packages-update;
|
||||
} else={
|
||||
/ system package update install without-paging;
|
||||
|
@ -27,14 +27,14 @@
|
|||
:error "Waiting for system to reboot.";
|
||||
}
|
||||
|
||||
:if ([ / system package print count-only where name="wireless" disabled=no ] > 0) do={
|
||||
: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) do={
|
||||
$LogPrintExit error "System is managed by CAPsMAN, not checking." true;
|
||||
}
|
||||
}
|
||||
|
||||
:if ([ / system scheduler print count-only 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.";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue