aboutsummaryrefslogtreecommitdiffstats
path: root/email-backup
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-04-29 16:26:31 +0200
committerGravatar Christian Hesse <mail@eworm.de>2021-04-29 22:37:36 +0200
commitd2560db5c96b5e2679178fd4f6595af89cab0801 (patch)
tree0b15c70107c7c68c5789d3cdc5f251867be68bba /email-backup
parent529cefffafca2dedd93f48303db73805d965431f (diff)
email-backup: use $SendEMail2change-49
This drops $EmailBackupTo & $EmailBackupCc from settings! Use settings overwrite if required: :global EmailGeneralToOverride { "email-backup"="backup@example.com"; }
Diffstat (limited to 'email-backup')
-rw-r--r--email-backup23
1 files changed, 9 insertions, 14 deletions
diff --git a/email-backup b/email-backup
index e9a75cd..0ba4d45 100644
--- a/email-backup
+++ b/email-backup
@@ -15,8 +15,6 @@
:global BackupSendBinary;
:global BackupSendExport;
:global Domain;
-:global EmailBackupCc;
-:global EmailBackupTo;
:global Identity;
:global CharacterReplace;
@@ -25,6 +23,7 @@
:global MkDir;
:global RandomDelay;
:global ScriptFromTerminal;
+:global SendEMail2;
:global WaitForFile;
:global WaitFullyConnected;
@@ -33,10 +32,6 @@
$LogPrintExit2 error $0 ("Configured to send neither backup nor config export.") true;
}
-:if ([ :len $EmailBackupTo ] = 0) do={
- $LogPrintExit2 error $0 ("Configuration is missing recipient for e-mail backup.") true;
-}
-
$WaitFullyConnected;
:if ([ $ScriptFromTerminal $0 ] = false && $BackupRandomDelay > 0) do={
@@ -71,11 +66,11 @@ $WaitFullyConnected;
}
# send email with status and files
-/ tool e-mail send to=$EmailBackupTo cc=$EmailBackupCc \
- subject=("[" . $Identity . "] Backup & Config") \
- body=("See attached files for backup and config export for " . \
- $Identity . ".\n\n" . \
- [ $DeviceInfo ] . "\n\n" . \
- "Backup file: " . $BackupFile . "\n" . \
- "Config file: " . $ConfigFile) \
- file=$Attach;
+$SendEMail2 ({ origin=$0; \
+ subject=("Backup & Config"); \
+ message=("See attached files for backup and config export for " . \
+ $Identity . ".\n\n" . \
+ [ $DeviceInfo ] . "\n\n" . \
+ "Backup file: " . $BackupFile . "\n" . \
+ "Config file: " . $ConfigFile); \
+ attach=$Attach });