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

Send an email before terminating upon an error.

Refers to #18, #28
parent 61db2dab
No related branches found
No related tags found
No related merge requests found
......@@ -614,7 +614,9 @@ Write-Verbose "Required update action items:`n> - $($UpdItems -join "`n> - ")`n"
if ($ConfigShouldBeUpdated) {
$ConfigUpdated = Update-Configuration
if (-Not $ConfigUpdated) {
Log-Error "Updating the configuration failed, $($Me) terminating!"
$msg = "Updating the configuration failed, $($Me) terminating!"
Log-Error $msg
Send-MailReport -Subject "updated failed!" -Body $msg
Exit
}
}
......@@ -622,7 +624,9 @@ if ($ConfigShouldBeUpdated) {
if ($ServiceShouldBeUpdated) {
$ServiceUpdated = Update-ServiceBinaries
if (-Not $ServiceUpdated) {
Log-Error "Updating the service binaries failed, $($Me) terminating!"
$msg = "Updating the service binaries failed, $($Me) terminating!"
Log-Error $msg
Send-MailReport -Subject "updated failed!" -Body $msg
Exit
}
}
......
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