mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-17 16:21:15 +02:00
global-functions: $DeviceInfo: handle configuration version
This commit is contained in:
parent
94581741f4
commit
2258087aab
1 changed files with 10 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
#!rsc
|
#!rsc
|
||||||
# RouterOS script: global-functions
|
# RouterOS script: global-functions
|
||||||
# Copyright (c) 2013-2019 Christian Hesse <mail@eworm.de>
|
# Copyright (c) 2013-2019 Christian Hesse <mail@eworm.de>
|
||||||
|
# Michael Gisbers <michael@gisbers.de>
|
||||||
#
|
#
|
||||||
# global functions
|
# global functions
|
||||||
|
|
||||||
|
@ -297,6 +298,8 @@
|
||||||
|
|
||||||
# get readable device info
|
# get readable device info
|
||||||
:global DeviceInfo do={
|
:global DeviceInfo do={
|
||||||
|
:global ExpectedConfigVersion;
|
||||||
|
:global GlobalConfigVersion;
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
:local BoardName [ / system resource get board-name ];
|
:local BoardName [ / system resource get board-name ];
|
||||||
|
@ -320,6 +323,13 @@
|
||||||
:set Info ($Info . "\n" . \
|
:set Info ($Info . "\n" . \
|
||||||
" Available: " . $Update->"latest-version");
|
" 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;
|
:return $Info;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue