From 7b1c275cc2daabf29e2d027ebab3d8d2e5e07b33 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 2 Apr 2019 08:48:35 +0200 Subject: script-updates: add option to ignore global-config changes --- global-config | 3 ++- global-config.changes | 1 + global-functions | 2 +- script-updates | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/global-config b/global-config index b57c212..03c9a5c 100644 --- a/global-config +++ b/global-config @@ -6,7 +6,7 @@ # Make sure all configuration properties are up to date and this # value is in sync with value in script 'global-functions'! -:global GlobalConfigVersion 3; +:global GlobalConfigVersion 4; # This is used for DNS and backup file. :global Domain "example.com"; @@ -93,6 +93,7 @@ :global ScriptUpdatesIgnore { "global-config" } +:global ScriptUpdatesConfigChangesIgnore false; # Use this for certificate auto-renew :global CertRenewUrl ""; diff --git a/global-config.changes b/global-config.changes index 86a130f..b1fae6e 100644 --- a/global-config.changes +++ b/global-config.changes @@ -6,4 +6,5 @@ 1="moved variables from global-config to global-functions for independence"; 2="variable names became CamelCase to work around scripting issues"; 3="variable for certificate renew passphrase became an array to support multiple passphrases"; + 4="added option to ignore global-config changes"; }; diff --git a/global-functions b/global-functions index 69f2c36..e5dc072 100644 --- a/global-functions +++ b/global-functions @@ -5,7 +5,7 @@ # global functions # expected configuration version -:global ExpectedConfigVersion 3; +:global ExpectedConfigVersion 4; # global variables not to be changed by user :global SentRouterosUpdateNotification "-"; diff --git a/script-updates b/script-updates index d2390db..6ba953c 100644 --- a/script-updates +++ b/script-updates @@ -11,6 +11,7 @@ :global ScriptUpdatesBaseUrl; :global ScriptUpdatesUrlSuffix; :global ScriptUpdatesIgnore; +:global ScriptUpdatesConfigChangesIgnore; :global SendNotification; @@ -77,7 +78,7 @@ } } -:if ($GlobalConfigVersion < $ExpectedConfigVersion) do={ +:if ($ScriptUpdatesConfigChangesIgnore!=true && $GlobalConfigVersion < $ExpectedConfigVersion) do={ :global GlobalConfigChanges; :local ChangeLogCode; :local Changes; -- cgit v1.2.3-54-g00ecf