aboutsummaryrefslogtreecommitdiffstats
path: root/script-updates
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-01-03 15:36:26 +0100
committerGravatar Christian Hesse <mail@eworm.de>2019-01-03 15:36:26 +0100
commit6e03a3b93514c435ee6e5de91c1fda0c1a318c1c (patch)
tree61909847f62cfc4be2f3e9e999dd9ea84ad94a48 /script-updates
parent0f72662745cc83e074d55e6849bcab15246ce152 (diff)
script-updates: add configuration versioning
Diffstat (limited to 'script-updates')
-rw-r--r--script-updates13
1 files changed, 13 insertions, 0 deletions
diff --git a/script-updates b/script-updates
index 9dae710..5ed0f5b 100644
--- a/script-updates
+++ b/script-updates
@@ -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.");
+}