global-functions: introduce and use $DeviceInfo

This commit is contained in:
Christian Hesse 2019-09-12 13:45:44 +02:00
parent 23b38fa15a
commit 94581741f4
5 changed files with 41 additions and 47 deletions

View file

@ -7,13 +7,9 @@
:global Identity;
:global BackupPassword;
:global DeviceInfo;
:global SendNotification;
# get some system information
:local BoardName [ / system resource get board-name ];
:local RouterBoard [ / system routerboard get ];
:local Update [ / system package update get ];
:do {
# we are not interested in output, but print without count-only is
# required to fetch information from cloud
@ -29,12 +25,7 @@
$SendNotification "Cloud backup" \
("Uploaded backup for " . $Identity . " to cloud.\n\n" . \
"Board name: " . $BoardName . "\n" . \
"Model: " . $RouterBoard->"model" . "\n" . \
"Serial number: " . $RouterBoard->"serial-number" . "\n" . \
"Hostname: " . $Identity . "\n" . \
"Channel: " . $Update->"channel" . "\n" . \
"RouterOS: " . $Update->"installed-version" . "\n\n" . \
[ $DeviceInfo ] . "\n\n" . \
"Name: " . $Cloud->"name" . "\n" . \
"Size: " . $Cloud->"size" . "\n" . \
"Download key: " . $Cloud->"secret-download-key") "" "true";