mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-07-30 13:11:36 +00:00
global-functions: $ScriptInstallUpdate: support setting policy
This commit is contained in:
parent
deee37d918
commit
461aab48e8
1 changed files with 8 additions and 1 deletions
|
|
@ -1434,8 +1434,15 @@
|
|||
:error false;
|
||||
}
|
||||
|
||||
:local ReqPolicy [ $ParseKeyValueStore [ $Grep $SourceNew ("\23 requires policy, ") ] ];
|
||||
:if ([ :len ($ReqPolicy->"policy") ] > 0) do={
|
||||
:set ($ScriptVal->"policy") [ :toarray delimiter=";" ($ReqPolicy->"policy") ];
|
||||
$LogPrint debug $0 ("New policy for script '" . $ScriptVal->"name" . \
|
||||
"': " . ($ReqPolicy->"policy"));
|
||||
}
|
||||
|
||||
$LogPrint info $0 ("Updating script: " . $ScriptVal->"name");
|
||||
/system/script/set owner=($ScriptVal->"name") \
|
||||
/system/script/set owner=($ScriptVal->"name") policy=($ScriptVal->"policy") \
|
||||
source=[ $IfThenElse ($ScriptUpdatesCRLF = true) $SourceCRLF $SourceNew ] $Script;
|
||||
:if ($ScriptVal->"name" = "global-config" || \
|
||||
$ScriptVal->"name" = "global-functions" || \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue