aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-08-07 13:02:58 +0200
committerGravatar Christian Hesse <mail@eworm.de>2023-08-07 22:10:44 +0200
commit5ea74968d942140aea79b7e001c8174f32b77e46 (patch)
tree02a833f88862995a21054edaecba82fe113c2248
parent0f787f9b030408fd2500bb036ff5816df27012b0 (diff)
capsman-download-packages: find script by code comment
-rw-r--r--capsman-download-packages.rsc5
-rw-r--r--capsman-rolling-upgrade.rsc2
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 <michael@gisbers.de>
# 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