mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-31 08:14:56 +02:00
global-functions: $DeviceInfo: also show commit info
This commit is contained in:
parent
dafcc1a0cb
commit
75633872aa
1 changed files with 4 additions and 2 deletions
|
@ -12,8 +12,9 @@
|
||||||
|
|
||||||
:local ScriptName [ :jobname ];
|
:local ScriptName [ :jobname ];
|
||||||
|
|
||||||
# expected configuration version
|
# Git commit id & info, expected configuration version
|
||||||
:global CommitId "unknown";
|
:global CommitId "unknown";
|
||||||
|
:global CommitInfo "unknown";
|
||||||
:global ExpectedConfigVersion 133;
|
:global ExpectedConfigVersion 133;
|
||||||
|
|
||||||
# global variables not to be changed by user
|
# global variables not to be changed by user
|
||||||
|
@ -286,6 +287,7 @@
|
||||||
# get readable device info
|
# get readable device info
|
||||||
:set DeviceInfo do={
|
:set DeviceInfo do={
|
||||||
:global CommitId;
|
:global CommitId;
|
||||||
|
:global CommitInfo;
|
||||||
:global ExpectedConfigVersion;
|
:global ExpectedConfigVersion;
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
|
@ -327,7 +329,7 @@
|
||||||
([ $FormatLine " Firmware" ($RouterBoard->"current-firmware") ] . "\n") ] . \
|
([ $FormatLine " Firmware" ($RouterBoard->"current-firmware") ] . "\n") ] . \
|
||||||
"RouterOS-Scripts:\n" . \
|
"RouterOS-Scripts:\n" . \
|
||||||
[ $IfThenElse ($CommitId != "unknown") \
|
[ $IfThenElse ($CommitId != "unknown") \
|
||||||
([ $FormatLine " Commit" [ :pick $CommitId 0 8 ] ] . "\n") ] . \
|
([ $FormatLine " Commit" ($CommitInfo . "/" . [ :pick $CommitId 0 8 ]) ] . "\n") ] . \
|
||||||
[ $FormatLine " Version" $ExpectedConfigVersion ]);
|
[ $FormatLine " Version" $ExpectedConfigVersion ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue