global-functions: $ScriptInstallUpdate: handle scripts with DOS line endings

If the script is converted to DOS line endings (\r\n) on the device it
was no longer handled by $ScriptInstallUpdate. Let's change that...
This commit is contained in:
Christian Hesse 2023-05-31 23:55:12 +02:00
parent de8c534d41
commit 0b8979e5b5

View file

@ -832,7 +832,7 @@
:local ReloadGlobalConfig false;
:local UserAgent ("User-Agent: Mikrotik/" . [ /system/resource/get version ] . " Fetch");
:foreach Script in=[ /system/script/find where source~"^#!rsc by RouterOS\n" ] do={
:foreach Script in=[ /system/script/find where source~"^#!rsc by RouterOS\r?\n" ] do={
:local ScriptVal [ /system/script/get $Script ];
:local ScriptFile [ /file/find where name=("script-updates/" . $ScriptVal->"name") . ".rsc" ];
:local SourceNew;