aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-07-16 12:33:47 +0200
committerGravatar Christian Hesse <mail@eworm.de>2024-07-16 13:50:22 +0200
commitf2ca62aed0ff062b6e2dec13f8bb20e828bfdeb2 (patch)
treec54df69fa7d2e43c012abfdbe9e39bf927716c64 /global-functions.rsc
parenta26f78329a1e941fcab969611ffbb83af4f2ea01 (diff)
global-functions: $ScriptInstallUpdate: support storing with CRLF
Adding this in `global-config-overlay` make the scripts being stored with CRLF line breaks: :global ScriptUpdatesCRLF true; Handle with care, I do not recommend it. Thus it's just a hidden setting.
Diffstat (limited to 'global-functions.rsc')
-rw-r--r--global-functions.rsc4
1 files changed, 3 insertions, 1 deletions
diff --git a/global-functions.rsc b/global-functions.rsc
index 327443a..b824d62 100644
--- a/global-functions.rsc
+++ b/global-functions.rsc
@@ -1008,6 +1008,7 @@
:global IDonate;
:global NoNewsAndChangesNotification;
:global ScriptUpdatesBaseUrl;
+ :global ScriptUpdatesCRLF;
:global ScriptUpdatesUrlSuffix;
:global CertificateAvailable;
@@ -1081,7 +1082,8 @@
:if ([ $RequiredRouterOS $0 [ $EitherOr $Required "0.0" ] false ] = true) do={
:if ([ $ValidateSyntax $SourceNew ] = true) do={
$LogPrint info $0 ("Updating script: " . $ScriptVal->"name");
- /system/script/set owner=($ScriptVal->"name") source=$SourceNew $Script;
+ /system/script/set owner=($ScriptVal->"name") \
+ source=[ $IfThenElse ($ScriptUpdatesCRLF = true) $SourceCRLF $SourceNew ] $Script;
:if ($ScriptVal->"name" = "global-config") do={
:set ReloadGlobalConfig true;
}