mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global-functions: $DeviceInfo: use $FormatLine
This commit is contained in:
parent
cb338c76a8
commit
fb12aabf3e
1 changed files with 16 additions and 15 deletions
|
@ -195,6 +195,7 @@
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
:global IfThenElse;
|
:global IfThenElse;
|
||||||
|
:global FormatLine;
|
||||||
|
|
||||||
:local Resource [ /system/resource/get ];
|
:local Resource [ /system/resource/get ];
|
||||||
:local RouterBoard;
|
:local RouterBoard;
|
||||||
|
@ -205,27 +206,27 @@
|
||||||
:local Update [ /system/package/update/get ];
|
:local Update [ /system/package/update/get ];
|
||||||
|
|
||||||
:return ( \
|
:return ( \
|
||||||
"Hostname: " . $Identity . \
|
[ $FormatLine "Hostname" $Identity ] . "\n" . \
|
||||||
"\nBoard name: " . $Resource->"board-name" . \
|
[ $FormatLine "Board name" ($Resource->"board-name") ] . "\n" . \
|
||||||
"\nArchitecture: " . $Resource->"architecture-name" . \
|
[ $FormatLine "Architecture" ($Resource->"architecture-name") ] . "\n" . \
|
||||||
[ $IfThenElse ($RouterBoard->"routerboard" = true) \
|
[ $IfThenElse ($RouterBoard->"routerboard" = true) \
|
||||||
("\nModel: " . $RouterBoard->"model" . \
|
([ $FormatLine "Model" ($RouterBoard->"model") ] . \
|
||||||
[ $IfThenElse ([ :len ($RouterBoard->"revision") ] > 0) \
|
[ $IfThenElse ([ :len ($RouterBoard->"revision") ] > 0) \
|
||||||
(" " . $RouterBoard->"revision") ] . \
|
(" " . $RouterBoard->"revision") ] . "\n" . \
|
||||||
"\nSerial number: " . $RouterBoard->"serial-number") ] . \
|
[ $FormatLine "Serial number" ($RouterBoard->"serial-number") ] . "\n") ] . \
|
||||||
[ $IfThenElse ([ :len ($License->"level") ] > 0) \
|
[ $IfThenElse ([ :len ($License->"level") ] > 0) \
|
||||||
("\nLicense: " . $License->"level") ] . \
|
([ $FormatLine "License" ($License->"level") ] . "\n") ] . \
|
||||||
"\nRouterOS:" . \
|
"RouterOS:\n" . \
|
||||||
"\n Channel: " . $Update->"channel" . \
|
[ $FormatLine " Channel" ($Update->"channel") ] . "\n" . \
|
||||||
"\n Installed: " . $Update->"installed-version" . \
|
[ $FormatLine " Installed" ($Update->"installed-version") ] . "\n" . \
|
||||||
[ $IfThenElse ([ :typeof ($Update->"latest-version") ] != "nothing" && \
|
[ $IfThenElse ([ :typeof ($Update->"latest-version") ] != "nothing" && \
|
||||||
$Update->"installed-version" != $Update->"latest-version") \
|
$Update->"installed-version" != $Update->"latest-version") \
|
||||||
("\n Available: " . $Update->"latest-version") ] . \
|
([ $FormatLine " Available" ($Update->"latest-version") ] . "\n") ] . \
|
||||||
[ $IfThenElse ($RouterBoard->"routerboard" = true && \
|
[ $IfThenElse ($RouterBoard->"routerboard" = true && \
|
||||||
$RouterBoard->"current-firmware" != $RouterBoard->"upgrade-firmware") \
|
$RouterBoard->"current-firmware" != $RouterBoard->"upgrade-firmware") \
|
||||||
("\n Firmware: " . $RouterBoard->"current-firmware") ] . \
|
([ $FormatLine " Firmware" ($RouterBoard->"current-firmware") ] . "\n") ] . \
|
||||||
"\nRouterOS-Scripts:" . \
|
"RouterOS-Scripts:\n" . \
|
||||||
"\n Version: " . $ExpectedConfigVersion);
|
[ $FormatLine " Version" $ExpectedConfigVersion ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
# convert line endings, DOS -> UNIX
|
# convert line endings, DOS -> UNIX
|
||||||
|
|
Loading…
Reference in a new issue