From ea73505ecce44ae7dd23ffc7ec16d47f1ee12040 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 3 Apr 2019 08:30:28 +0200 Subject: script-updates: send global-config changes notification just once --- global-functions | 1 + script-updates | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/global-functions b/global-functions index e5dc072..a4b0f99 100644 --- a/global-functions +++ b/global-functions @@ -8,6 +8,7 @@ :global ExpectedConfigVersion 4; # global variables not to be changed by user +:global SentConfigChangesNotification "-"; :global SentRouterosUpdateNotification "-"; :global SentLteFirmwareUpgradeNotification "-"; :global Identity [ / system identity get name ]; diff --git a/script-updates b/script-updates index 6ba953c..989cbf2 100644 --- a/script-updates +++ b/script-updates @@ -4,9 +4,10 @@ # # update installed scripts from file or url -:global GlobalConfigVersion; :global ExpectedConfigVersion; +:global GlobalConfigVersion; :global Identity; +:global SentConfigChangesNotification; :global ScriptUpdatesFetch; :global ScriptUpdatesBaseUrl; :global ScriptUpdatesUrlSuffix; @@ -78,7 +79,9 @@ } } -:if ($ScriptUpdatesConfigChangesIgnore!=true && $GlobalConfigVersion < $ExpectedConfigVersion) do={ +:if ($ScriptUpdatesConfigChangesIgnore!=true && \ + $SentConfigChangesNotification!=$ExpectedConfigVersion && \ + $GlobalConfigVersion < $ExpectedConfigVersion) do={ :global GlobalConfigChanges; :local ChangeLogCode; :local Changes; @@ -105,4 +108,5 @@ "GlobalConfigVersion (currently " . $GlobalConfigVersion . \ ") to " . $ExpectedConfigVersion . " and re-run global-config.\n\n" . \ "Changes:" . $Changes); + :set SentConfigChangesNotification $ExpectedConfigVersion; } -- cgit v1.2.3-54-g00ecf