From 8eaf24e27415ad56138cf2ec93eb850509e42b0c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 17 Jul 2020 12:00:59 +0200 Subject: upload-backup: change symbol to warning sign on failure --- upload-backup | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/upload-backup b/upload-backup index 6ad85ad..8d7dd28 100644 --- a/upload-backup +++ b/upload-backup @@ -17,6 +17,7 @@ :global CharacterReplace; :global DeviceInfo; +:global IfThenElse; :global LogPrintExit; :global SendNotification; :global SymbolForNotification; @@ -30,6 +31,7 @@ :local FileName [ $CharacterReplace ($Identity . "." . $Domain) "." "_" ]; :local BackupFile "none"; :local ConfigFile "none"; +:local Failed 0; # binary backup :if ($BackupSendBinary = true) do={ @@ -42,6 +44,7 @@ } on-error={ $LogPrintExit error ("Uploading backup file failed!") false; :set BackupFile "failed"; + :set Failed 1; } } @@ -56,10 +59,11 @@ } on-error={ $LogPrintExit error ("Uploading configuration export failed!") false; :set ConfigFile "failed"; + :set Failed 1; } } -$SendNotification ([ $SymbolForNotification "floppy-disk" ] . "Backup & Config Upload") \ +$SendNotification ([ $SymbolForNotification [ $IfThenElse ($Failed > 0) "warning-sign" "floppy-disk" ] ] . "Backup & Config Upload") \ ("Backup and config export upload for " . $Identity . ".\n\n" . \ [ $DeviceInfo ] . "\n\n" . \ "Backup file: " . $BackupFile . "\n" . \ -- cgit v1.2.3-70-g09d2