cloud-backup: pass origin to $SendNotification2

This commit is contained in:
Christian Hesse 2021-04-27 21:55:31 +02:00
parent 8e1c524b85
commit a9b932d67e

View file

@ -41,14 +41,16 @@ $WaitFullyConnected;
}
:local Cloud [ / system backup cloud get ([ find ]->0) ];
$SendNotification2 ({ subject=([ $SymbolForNotification "floppy-disk" ] . "Cloud backup"); \
$SendNotification2 ({ origin=$0; \
subject=([ $SymbolForNotification "floppy-disk" ] . "Cloud backup"); \
message=("Uploaded backup for " . $Identity . " to cloud.\n\n" . \
[ $DeviceInfo ] . "\n\n" . \
"Name: " . $Cloud->"name" . "\n" . \
"Size: " . $Cloud->"size" . " B (" . ($Cloud->"size" / 1024) . " KiB)\n" . \
"Download key: " . $Cloud->"secret-download-key"); silent=true });
} on-error={
$SendNotification2 ({ subject=([ $SymbolForNotification "warning-sign" ] . "Cloud backup failed"); \
$SendNotification2 ({ origin=$0; \
subject=([ $SymbolForNotification "warning-sign" ] . "Cloud backup failed"); \
message=("Failed uploading backup for " . $Identity . " to cloud!\n\n" . [ $DeviceInfo ]) });
$LogPrintExit2 error $0 ("Failed uploading backup for " . $Identity . " to cloud!") true;
}