diff options
-rw-r--r-- | global-functions | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/global-functions b/global-functions index 5f80c0b..60f72a4 100644 --- a/global-functions +++ b/global-functions @@ -32,6 +32,7 @@ :global GetRandom; :global RandomDelay; :global DeviceInfo; +:global ScriptInstallUpdate; # url encoding :set UrlEncode do={ @@ -412,3 +413,16 @@ :return $Info; } + +# install new scripts, update existing scripts +:set ScriptInstallUpdate do={ + :local Scripts [ :toarray $1 ]; + + :foreach Script in=$Scripts do={ + :if ([ / system script print count-only where name=$Script ] = 0) do={ + :log info ("Adding new script: " . $Script); + / system script add name=$Script source="#!rsc"; + } + } + / system script run script-updates; +} |