diff options
author | Christian Hesse <mail@eworm.de> | 2022-04-26 14:29:46 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-04-28 10:38:29 +0200 |
commit | d9c4e1e8d5cdc1beb447cfbc2d7c6fc2c672d082 (patch) | |
tree | 8c6f3a7ff90b93700f5eb53631f8aa8181425c31 | |
parent | 2e8f457109ed2689866501137e93a7378654b195 (diff) |
global-functions: $ScriptInstallUpdate: support giving comment...
... for new scripts. This allows to have extra settings from the
beginning, for example:
$ScriptInstallUpdate script1,script2 "base-url=https://example.com/your/custom/repository/"
(cherry picked from commit a058c9e1edd8dc4895a64881ee1b495e86fe7510)
-rw-r--r-- | global-functions | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/global-functions b/global-functions index 05a111c..65646ad 100644 --- a/global-functions +++ b/global-functions @@ -688,7 +688,8 @@ # install new scripts, update existing scripts :set ScriptInstallUpdate do={ - :local Scripts [ :toarray $1 ]; + :local Scripts [ :toarray $1 ]; + :local NewComment [ :tostr $2 ]; :global ExpectedConfigVersion; :global GlobalConfigVersion; @@ -715,7 +716,7 @@ :foreach Script in=$Scripts do={ :if ([ :len [ / system script find where name=$Script ] ] = 0) do={ $LogPrintExit2 info $0 ("Adding new script: " . $Script) false; - / system script add name=$Script source="#!rsc by RouterOS\n"; + / system script add name=$Script owner=$Script source="#!rsc by RouterOS\n" comment=$NewComment; } } |