mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
script-updates: add configuration versioning
This commit is contained in:
@ -4,11 +4,16 @@
|
||||
#
|
||||
# update installed scripts from file or url
|
||||
|
||||
:global GlobalConfigVersion;
|
||||
:global ExpectedConfigVersion;
|
||||
:global "identity";
|
||||
:global "script-updates-fetch";
|
||||
:global "script-updates-baseurl";
|
||||
:global "script-updates-urlsuffix";
|
||||
:global "script-updates-ignore";
|
||||
|
||||
:global SendNotification;
|
||||
|
||||
:foreach script in=[ / system script find ] do={
|
||||
:local ignore 0;
|
||||
:local scriptname [ / system script get $script name ];
|
||||
@ -71,3 +76,11 @@
|
||||
:log debug ("No update for script " . $scriptname);
|
||||
}
|
||||
}
|
||||
|
||||
:if ($GlobalConfigVersion < $ExpectedConfigVersion) do={
|
||||
$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.");
|
||||
}
|
||||
|
Reference in New Issue
Block a user