mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Add service start/stop if required while upgrading framework
This commit is contained in:
parent
2c4d482e28
commit
645744ff81
1 changed files with 10 additions and 0 deletions
|
|
@ -57,6 +57,12 @@ function Install-IcingaFrameworkUpdate()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$ServiceStatus = (Get-Service 'icingapowershell' -ErrorAction SilentlyContinue).Status;
|
||||||
|
|
||||||
|
if ($ServiceStatus -eq 'Running') {
|
||||||
|
Stop-IcingaService 'icingapowershell';
|
||||||
|
}
|
||||||
|
|
||||||
$NewDirectory = (Join-Path -Path $ModuleDirectory -ChildPath 'icinga-powershell-framework');
|
$NewDirectory = (Join-Path -Path $ModuleDirectory -ChildPath 'icinga-powershell-framework');
|
||||||
$ExtractDir = (Join-Path -Path $ModuleDirectory -ChildPath $Extracted);
|
$ExtractDir = (Join-Path -Path $ModuleDirectory -ChildPath $Extracted);
|
||||||
$BackupDir = (Join-Path -Path $ExtractDir -ChildPath 'previous');
|
$BackupDir = (Join-Path -Path $ExtractDir -ChildPath 'previous');
|
||||||
|
|
@ -95,5 +101,9 @@ function Install-IcingaFrameworkUpdate()
|
||||||
|
|
||||||
Test-IcingaAgent;
|
Test-IcingaAgent;
|
||||||
|
|
||||||
|
if ($ServiceStatus -eq 'Running') {
|
||||||
|
Start-IcingaService 'icingapowershell';
|
||||||
|
}
|
||||||
|
|
||||||
Write-Host 'Framework update has been completed';
|
Write-Host 'Framework update has been completed';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue