mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-21 19:34:41 +02:00
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/"
This commit is contained in:
parent
3f8d3acd60
commit
a058c9e1ed
1 changed files with 3 additions and 2 deletions
|
@ -684,7 +684,8 @@
|
||||||
|
|
||||||
# install new scripts, update existing scripts
|
# install new scripts, update existing scripts
|
||||||
:set ScriptInstallUpdate do={
|
:set ScriptInstallUpdate do={
|
||||||
:local Scripts [ :toarray $1 ];
|
:local Scripts [ :toarray $1 ];
|
||||||
|
:local NewComment [ :tostr $2 ];
|
||||||
|
|
||||||
:global ExpectedConfigVersion;
|
:global ExpectedConfigVersion;
|
||||||
:global GlobalConfigVersion;
|
:global GlobalConfigVersion;
|
||||||
|
@ -711,7 +712,7 @@
|
||||||
:foreach Script in=$Scripts do={
|
:foreach Script in=$Scripts do={
|
||||||
:if ([ :len [ / system script find where name=$Script ] ] = 0) do={
|
:if ([ :len [ / system script find where name=$Script ] ] = 0) do={
|
||||||
$LogPrintExit2 info $0 ("Adding new script: " . $Script) false;
|
$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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue