aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-02-18 21:27:54 +0100
committerGravatar Christian Hesse <mail@eworm.de>2021-02-18 21:45:38 +0100
commit2db73a189c6eb2cc16ec2f2a4c4b33133ae8130d (patch)
tree6161300168e9c5d584c0c3ca76085c45c0c074de /global-functions
parent148a7f93a6d61c7f7df931d9265dd9271da2cc91 (diff)
global-functions: $ScriptInstallUpdate: fix change notification
In RouterOS functions are of type 'array' with 'code' (numerical index 1) inside. Cast to string to make comparison work. Also define the function to make it available.
Diffstat (limited to 'global-functions')
-rw-r--r--global-functions5
1 files changed, 3 insertions, 2 deletions
diff --git a/global-functions b/global-functions
index b3a4f3c..bf09ad2 100644
--- a/global-functions
+++ b/global-functions
@@ -592,6 +592,7 @@
:global CertificateAvailable;
:global LogPrintExit;
:global ParseKeyValueStore;
+ :global ScriptInstallUpdate;
:global SendNotification;
:global SymbolForNotification;
@@ -606,7 +607,7 @@
}
}
- :local ScriptInstallUpdateBefore $ScriptInstallUpdate;
+ :local ScriptInstallUpdateBefore [ :tostr $ScriptInstallUpdate ];
:foreach Script in=[ / system script find where source~"^#!rsc( by RouterOS)\?\n" ] do={
:local ScriptVal [ / system script get $Script ];
@@ -747,7 +748,7 @@
:set SentConfigChangesNotification $ExpectedConfigVersion;
}
- :if ($ScriptInstallUpdateBefore != $ScriptInstallUpdate) do={
+ :if ($ScriptInstallUpdateBefore != [ :tostr $ScriptInstallUpdate ]) do={
$LogPrintExit info ("This function '\$ScriptInstallUpdate' changed, you may want to re-run.") false;
}
}