aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-02-07 20:29:13 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-02-07 21:19:57 +0100
commit0527503c8e357e7cff99231b3cce2c153c9d6132 (patch)
treeee6b58e9b29ca5c27722e0a8039a5f9fee0b9a47
parent48bf54644aadf1f289080f83ecfd06ee936ead78 (diff)
backup-email: support sending global-config-overlay
-rw-r--r--backup-email14
1 files changed, 13 insertions, 1 deletions
diff --git a/backup-email b/backup-email
index 158e746..50c5ce5 100644
--- a/backup-email
+++ b/backup-email
@@ -16,6 +16,7 @@
:global BackupRandomDelay;
:global BackupSendBinary;
:global BackupSendExport;
+:global BackupSendGlobalConfig;
:global Domain;
:global Identity;
@@ -50,6 +51,7 @@ $WaitFullyConnected;
:local FileName [ $CharacterReplace ($Identity . "." . $Domain) "." "_" ];
:local FilePath ($DirName . "/" . $FileName);
:local BackupFile "none";
+:local ExportFile "none";
:local ConfigFile "none";
:local Attach ({});
@@ -69,10 +71,19 @@ $WaitFullyConnected;
:if ($BackupSendExport = true) do={
/export terse show-sensitive file=$FilePath;
$WaitForFile ($FilePath . ".rsc");
- :set ConfigFile ($FileName . ".rsc");
+ :set ExportFile ($FileName . ".rsc");
:set Attach ($Attach, ($FilePath . ".rsc"));
}
+# global-config-overlay
+:if ($BackupSendGlobalConfig = true) do={
+ :execute script={ / } file=($FilePath . ".conf");
+ $WaitForFile ($FilePath . ".conf.txt");
+ /file/set ($FilePath . ".conf.txt") contents=[ /system/script/get global-config-overlay source ];
+ :set ConfigFile ($FileName . ".conf.txt");
+ :set Attach ($Attach, ($FilePath . ".conf.txt"));
+}
+
# send email with status and files
$SendEMail2 ({ origin=$0; \
subject=([ $SymbolForNotification "floppy-disk,incoming-envelope" ] . \
@@ -81,6 +92,7 @@ $SendEMail2 ({ origin=$0; \
$Identity . ".\n\n" . \
[ $DeviceInfo ] . "\n\n" . \
"Backup file: " . $BackupFile . "\n" . \
+ "Export file: " . $ExportFile . "\n" . \
"Config file: " . $ConfigFile); \
attach=$Attach; remove-attach=true });