mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-03 17:54:41 +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
17
email-backup
17
email-backup
|
@ -13,6 +13,7 @@
|
|||
:global BackupPassword;
|
||||
|
||||
:global CharacterReplace;
|
||||
:global DeviceInfo;
|
||||
|
||||
:if ($BackupSendBinary != true && \
|
||||
$BackupSendExport != true) do={
|
||||
|
@ -26,11 +27,6 @@
|
|||
:local ConfigFile "none";
|
||||
:local Attach [ :toarray "" ];
|
||||
|
||||
# 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;
|
||||
|
@ -49,13 +45,8 @@
|
|||
/ tool e-mail send to=$EmailBackupTo cc=$EmailBackupCc \
|
||||
subject=("[" . $Identity . "] Backup & Config") \
|
||||
body=("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 file: " . $BackupFile . "\n" . \
|
||||
"Config file: " . $ConfigFile) \
|
||||
[ $DeviceInfo ] . "\n\n" . \
|
||||
"Backup file: " . $BackupFile . "\n" . \
|
||||
"Config file: " . $ConfigFile) \
|
||||
file=$Attach;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue