From e74ffcd1d99e81baf74fb74e4b71f67c2a222422 Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Fri, 8 Dec 2017 17:03:59 +0100
Subject: [PATCH] Check final status and send mail report if applicable.

Refers to #13
---
 AutoTx-Updater/Update-Service.ps1 | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/AutoTx-Updater/Update-Service.ps1 b/AutoTx-Updater/Update-Service.ps1
index 5b0c4ff..d08e3b7 100644
--- a/AutoTx-Updater/Update-Service.ps1
+++ b/AutoTx-Updater/Update-Service.ps1
@@ -316,6 +316,18 @@ Exit-IfDirMissing $UpdateMarkerPath "update marker"
 Exit-IfDirMissing $UpdateBinariesPath "service binaries update"
 
 $ConfigUpdated = Update-Configuration
-# Update-ServiceBinaries
+$ServiceUpdated = Update-ServiceBinaries
 
-Start-MyService
+$msg = ""
+if ($ConfigUpdated) {
+    $msg += "The configuration files were updated.`n"
+}
+if ($ServiceUpdated) {
+    $msg += "The service binaries were updated.`n"
+}
+
+if ($msg -ne "") {
+    Start-MyService
+    Send-MailReport -Subject "Config and / or service has been updated!" `
+        -Body $msg
+}
-- 
GitLab