From 40201ac1ea8e27492587d0cebdd0d6b8c24b733a Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 1 Apr 2019 11:12:34 +0200 Subject: script-updates: add changelog for global configuration --- script-updates | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'script-updates') diff --git a/script-updates b/script-updates index 971f2e4..d2390db 100644 --- a/script-updates +++ b/script-updates @@ -78,9 +78,30 @@ } :if ($GlobalConfigVersion < $ExpectedConfigVersion) do={ + :global GlobalConfigChanges; + :local ChangeLogCode; + :local Changes; + + :log debug ("Fetching changelog."); + :do { + :local Result [ / tool fetch check-certificate=yes-without-crl \ + ($ScriptUpdatesBaseUrl . "global-config.changes" . $ScriptUpdatesUrlSuffix) \ + output=user as-value ]; + :if ($Result->"status" = "finished") do={ + :set ChangeLogCode ($Result->"data"); + } + } on-error={ + :log info ("Failed fetching changes!"); + } + [ :parse $ChangeLogCode ]; + :for I from=($GlobalConfigVersion + 1) to=$ExpectedConfigVersion do={ + :set Changes ( $Changes . "\n * " . $GlobalConfigChanges->[ :tostr $I ] ); + } + $SendNotification "Configuration warning!" \ ("Current configuration on " . $Identity . " is out of date. " . \ "Please update global-config, then increase variable " . \ "GlobalConfigVersion (currently " . $GlobalConfigVersion . \ - ") to " . $ExpectedConfigVersion . " and re-run global-config."); + ") to " . $ExpectedConfigVersion . " and re-run global-config.\n\n" . \ + "Changes:" . $Changes); } -- cgit v1.2.3-70-g09d2