mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-25 21:34:30 +02:00
global-functions: $DeviceInfo: show commit id (if available)
This commit is contained in:
parent
5715bc7b57
commit
584e507fd1
1 changed files with 4 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
||||||
:local ScriptName [ :jobname ];
|
:local ScriptName [ :jobname ];
|
||||||
|
|
||||||
# expected configuration version
|
# expected configuration version
|
||||||
|
:global CommitId "unknown";
|
||||||
:global ExpectedConfigVersion 133;
|
:global ExpectedConfigVersion 133;
|
||||||
|
|
||||||
# global variables not to be changed by user
|
# global variables not to be changed by user
|
||||||
|
@ -284,6 +285,7 @@
|
||||||
|
|
||||||
# get readable device info
|
# get readable device info
|
||||||
:set DeviceInfo do={
|
:set DeviceInfo do={
|
||||||
|
:global CommitId;
|
||||||
:global ExpectedConfigVersion;
|
:global ExpectedConfigVersion;
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
|
@ -324,6 +326,8 @@
|
||||||
$RouterBoard->"current-firmware" != $RouterBoard->"upgrade-firmware") \
|
$RouterBoard->"current-firmware" != $RouterBoard->"upgrade-firmware") \
|
||||||
([ $FormatLine " Firmware" ($RouterBoard->"current-firmware") ] . "\n") ] . \
|
([ $FormatLine " Firmware" ($RouterBoard->"current-firmware") ] . "\n") ] . \
|
||||||
"RouterOS-Scripts:\n" . \
|
"RouterOS-Scripts:\n" . \
|
||||||
|
[ $IfThenElse ($CommitId != "unknown") \
|
||||||
|
([ $FormatLine " Commit" [ :pick $CommitId 0 8 ] ] . "\n") ] . \
|
||||||
[ $FormatLine " Version" $ExpectedConfigVersion ]);
|
[ $FormatLine " Version" $ExpectedConfigVersion ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue