global-functions: $ScriptInstallUpdate: give hint on changes

This commit is contained in:
Christian Hesse 2021-01-21 11:15:49 +01:00
parent 99aaf642b2
commit 086a395e82

View file

@ -597,6 +597,8 @@
} }
} }
:local ScriptInstallUpdateBefore $ScriptInstallUpdate;
:foreach Script in=[ / system script find where source~"^#!rsc( by RouterOS)\?\n" ] do={ :foreach Script in=[ / system script find where source~"^#!rsc( by RouterOS)\?\n" ] do={
:local ScriptVal [ / system script get $Script ]; :local ScriptVal [ / system script get $Script ];
:local ScriptFile [ / file find where name=("script-updates/" . $ScriptVal->"name") ]; :local ScriptFile [ / file find where name=("script-updates/" . $ScriptVal->"name") ];
@ -735,6 +737,10 @@
$NotificationMessage $Link; $NotificationMessage $Link;
:set SentConfigChangesNotification $ExpectedConfigVersion; :set SentConfigChangesNotification $ExpectedConfigVersion;
} }
:if ($ScriptInstallUpdateBefore != $ScriptInstallUpdate) do={
$LogPrintExit info ("This function '\$ScriptInstallUpdate' changed, you may want to re-run.") false;
}
} }
# lock script against multiple invocation # lock script against multiple invocation