Skip to content
Snippets Groups Projects
Commit 577154e3 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Adapt update wrap-up and message generation to recent changes.

Refers to #18, #28
parent fde22723
No related branches found
No related tags found
No related merge requests found
...@@ -617,7 +617,6 @@ if ($ConfigShouldBeUpdated) { ...@@ -617,7 +617,6 @@ if ($ConfigShouldBeUpdated) {
Log-Error "Updating the configuration failed, $($Me) terminating!" Log-Error "Updating the configuration failed, $($Me) terminating!"
Exit Exit
} }
$UpdSummary += "The configuration files were updated.`n"
} }
if ($ServiceShouldBeUpdated) { if ($ServiceShouldBeUpdated) {
...@@ -628,20 +627,26 @@ if ($ServiceShouldBeUpdated) { ...@@ -628,20 +627,26 @@ if ($ServiceShouldBeUpdated) {
} }
} }
Exit $UpdSummary = "Updated $($UpdItems -join " and ")."
if ($msg -ne "") {
if ($ServiceRunningBefore) { if ($ServiceRunningBefore) {
Log-Debug "Update action occurred, finishing up..." Log-Debug "$($UpdSummary) Trying to start the service again..."
Start-MyService Start-MyService
} else { } else {
Log-Debug "Not starting the service as it was not running before." Log-Debug "$($UpdSummary) Leaving the service stopped, as it was before."
} }
Send-MailReport -Subject "Config and / or service has been updated!" `
-Body $msg $UpdDetails = $("An $($Me) run completed successfully. Updated items:"
"`n> - $($UpdItems -join "`n> - ")")
if ($ConfigUpdated) {
$UpdDetails += "`n`nConfiguration validation summary:`n$($ConfigSummary)"
} }
Send-MailReport -Subject "$UpdSummary" -Body "$UpdDetails"
Upload-LogFiles Upload-LogFiles
Log-Debug "$($Me) finished." Log-Debug "$($Me) finished."
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment