mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
global-functions: $DeviceInfo: handle configuration version
This commit is contained in:
committed by
Christian Hesse
parent
94581741f4
commit
2258087aab
@@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user