global-functions: $DeviceInfo: show license level if available

This now shows license level for CHR.

The property is named different for Routerboards. As these have the
license bundled to hardware anyway we do not show it there.
This commit is contained in:
Christian Hesse 2021-12-13 15:37:20 +01:00
parent 40dea01670
commit 0fab371d1a

View file

@ -201,6 +201,7 @@
:do {
:set RouterBoard [ / system routerboard get ];
} on-error={ }
:local License [ / system license get ];
:local Update [ / system package update get ];
:return ( \
@ -212,6 +213,8 @@
[ $IfThenElse ([ :len ($RouterBoard->"revision") ] > 0) \
(" " . $RouterBoard->"revision") ] . \
"\nSerial number: " . $RouterBoard->"serial-number") ] . \
[ $IfThenElse ([ :len ($License->"level") ] > 0) \
("\nLicense: " . $License->"level") ] . \
"\nRouterOS:" . \
"\n Channel: " . $Update->"channel" . \
"\n Installed: " . $Update->"installed-version" . \