mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-02 17:24:51 +02:00
global-functions: introduce and use $DeviceInfo
This commit is contained in:
parent
23b38fa15a
commit
94581741f4
5 changed files with 41 additions and 47 deletions
|
@ -14,6 +14,7 @@
|
|||
:global BackupPassword;
|
||||
|
||||
:global CharacterReplace;
|
||||
:global DeviceInfo;
|
||||
:global SendNotification;
|
||||
|
||||
:if ($BackupSendBinary != true && \
|
||||
|
@ -27,11 +28,6 @@
|
|||
:local BackupFile "none";
|
||||
:local ConfigFile "none";
|
||||
|
||||
# get some system information
|
||||
:local BoardName [ / system resource get board-name ];
|
||||
:local RouterBoard [ / system routerboard get ];
|
||||
:local Update [ / system package update get ];
|
||||
|
||||
# binary backup
|
||||
:if ($BackupSendBinary = true) do={
|
||||
/ system backup save encryption=aes-sha256 name=$FileName password=$BackupPassword;
|
||||
|
@ -62,12 +58,7 @@
|
|||
|
||||
$SendNotification "Backup & Config Upload" \
|
||||
("Backup and config export for " . $Identity . ".\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" . \
|
||||
"Backup uploaded: " . $BackupFile . "\n" . \
|
||||
"Config uploaded: " . $ConfigFile) "" "true";
|
||||
[ $DeviceInfo ] . "\n\n" . \
|
||||
"Backup file: " . $BackupFile . "\n" . \
|
||||
"Config file: " . $ConfigFile) "" "true";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue