aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions
diff options
context:
space:
mode:
authorGravatar Michael Gisbers <michael@gisbers.de>2019-09-12 13:48:46 +0200
committerGravatar Christian Hesse <mail@eworm.de>2019-09-12 21:29:41 +0200
commit2258087aab5c94a3970685f7f25587ed5403111d (patch)
treed48a115041dbb0d2ef5e94ffea767545162769cd /global-functions
parent94581741f42d809a1364accda57cdf1d57519ffa (diff)
global-functions: $DeviceInfo: handle configuration version
Diffstat (limited to 'global-functions')
-rw-r--r--global-functions10
1 files changed, 10 insertions, 0 deletions
diff --git a/global-functions b/global-functions
index 87cda40..371c230 100644
--- a/global-functions
+++ b/global-functions
@@ -1,6 +1,7 @@
#!rsc
# RouterOS script: global-functions
# Copyright (c) 2013-2019 Christian Hesse <mail@eworm.de>
+# Michael Gisbers <michael@gisbers.de>
#
# global functions
@@ -297,6 +298,8 @@
# get readable device info
:global DeviceInfo do={
+ :global ExpectedConfigVersion;
+ :global GlobalConfigVersion;
:global Identity;
:local BoardName [ / system resource get board-name ];
@@ -320,6 +323,13 @@
:set Info ($Info . "\n" . \
" Available: " . $Update->"latest-version");
}
+ :set Info ($Info . "\n" . \
+ "RouterOS-Scripts Configuration Version:\n" . \
+ " Current: " . $GlobalConfigVersion);
+ :if ($GlobalConfigVersion != $ExpectedConfigVersion) do={
+ :set Info ($Info . "\n" . \
+ " Expected: " . $ExpectedConfigVersion);
+ }
:return $Info;
}