diff options
author | Christian Hesse <mail@eworm.de> | 2020-08-26 09:23:56 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-08-26 09:29:52 +0200 |
commit | ff5cdc30193ba69944f6772f213e63ea00678861 (patch) | |
tree | d73fac7cd08f5463c8a432dd5153695ae0cf2cf1 /check-routeros-update | |
parent | 92ca31a41df332171d1f2dcf08c75db570b12234 (diff) |
[ ... 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...
Diffstat (limited to 'check-routeros-update')
-rw-r--r-- | check-routeros-update | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/check-routeros-update b/check-routeros-update index b1e40e4..073ed96 100644 --- a/check-routeros-update +++ b/check-routeros-update @@ -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."; } |