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) {
Log-Error "Updating the configuration failed, $($Me) terminating!"
Exit
}
$UpdSummary += "The configuration files were updated.`n"
}
if ($ServiceShouldBeUpdated) {
......@@ -628,20 +627,26 @@ if ($ServiceShouldBeUpdated) {
}
}
Exit
$UpdSummary = "Updated $($UpdItems -join " and ")."
if ($msg -ne "") {
if ($ServiceRunningBefore) {
Log-Debug "Update action occurred, finishing up..."
Start-MyService
} else {
Log-Debug "Not starting the service as it was not running before."
}
Send-MailReport -Subject "Config and / or service has been updated!" `
-Body $msg
if ($ServiceRunningBefore) {
Log-Debug "$($UpdSummary) Trying to start the service again..."
Start-MyService
} else {
Log-Debug "$($UpdSummary) Leaving the service stopped, as it was before."
}
$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
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.
Finish editing this message first!
Please register or to comment