From ff5cdc30193ba69944f6772f213e63ea00678861 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 26 Aug 2020 09:23:56 +0200 Subject: [ ... 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... --- check-routeros-update | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'check-routeros-update') 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."; } -- cgit v1.2.3-54-g00ecf