mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-25 21:34:30 +02:00
script-updates: add changelog for global configuration
This commit is contained in:
parent
6388a97f31
commit
40201ac1ea
2 changed files with 30 additions and 1 deletions
8
global-config.changes
Normal file
8
global-config.changes
Normal file
|
@ -0,0 +1,8 @@
|
|||
# RouterOS global-config changes
|
||||
# Copyright (c) 2019 Christian Hesse <mail@eworm.de>
|
||||
|
||||
# Changes for global-config to be added to notification on script-updates
|
||||
:global GlobalConfigChanges {
|
||||
1="moved variables from global-config to global-functions for independence";
|
||||
2="variable names became CamelCase to work around scripting issues";
|
||||
};
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue