From 5ea74968d942140aea79b7e001c8174f32b77e46 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 7 Aug 2023 13:02:58 +0200 Subject: capsman-download-packages: find script by code comment --- capsman-download-packages.rsc | 5 +++-- capsman-rolling-upgrade.rsc | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/capsman-download-packages.rsc b/capsman-download-packages.rsc index 08edd59..2dd3bcd 100644 --- a/capsman-download-packages.rsc +++ b/capsman-download-packages.rsc @@ -78,8 +78,9 @@ $WaitFullyConnected; } :if ($Updated = true) do={ - :if ([ :len [ /system/script/find where name="capsman-rolling-upgrade" ] ] > 0) do={ - /system/script/run capsman-rolling-upgrade; + :local Script ([ /system/script/find where source~"\n# provides: capsman-rolling-upgrade\n" ]->0); + :if ([ :len $Script ] > 0) do={ + /system/script/run $Script; } else={ /caps-man/remote-cap/upgrade [ find where version!=$InstalledVersion ]; } diff --git a/capsman-rolling-upgrade.rsc b/capsman-rolling-upgrade.rsc index 1f4a51c..91a6400 100644 --- a/capsman-rolling-upgrade.rsc +++ b/capsman-rolling-upgrade.rsc @@ -4,6 +4,8 @@ # Michael Gisbers # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # +# provides: capsman-rolling-upgrade +# # upgrade CAPs one after another # https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-rolling-upgrade.md -- cgit v1.2.3-70-g09d2