global-functions: $DeviceInfo: show commit id (if available)

This commit is contained in:
Christian Hesse 2025-02-13 08:50:49 +01:00
parent 5715bc7b57
commit 584e507fd1

View file

@ -13,6 +13,7 @@
:local ScriptName [ :jobname ];
# expected configuration version
:global CommitId "unknown";
:global ExpectedConfigVersion 133;
# global variables not to be changed by user
@ -284,6 +285,7 @@
# get readable device info
:set DeviceInfo do={
:global CommitId;
:global ExpectedConfigVersion;
:global Identity;
@ -324,6 +326,8 @@
$RouterBoard->"current-firmware" != $RouterBoard->"upgrade-firmware") \
([ $FormatLine " Firmware" ($RouterBoard->"current-firmware") ] . "\n") ] . \
"RouterOS-Scripts:\n" . \
[ $IfThenElse ($CommitId != "unknown") \
([ $FormatLine " Commit" [ :pick $CommitId 0 8 ] ] . "\n") ] . \
[ $FormatLine " Version" $ExpectedConfigVersion ]);
}