Fixes crash on existing service binary file

This commit is contained in:
Lord Hepipud 2019-10-31 16:36:55 +01:00
parent 78a2cf4466
commit 621af88831

View file

@ -31,6 +31,16 @@ function Get-IcingaFrameworkServiceBinary()
Invoke-WebRequest -Uri $FrameworkServiceUrl -UseBasicParsing -OutFile $ZipArchive;
if ((Test-Path $ServiceBin)) {
Write-Host 'Icinga Service Binary already present. Skipping extrating';
return @{
'FrameworkServiceUrl' = $FrameworkServiceUrl;
'ServiceDirectory' = $ServiceDirectory;
'ServiceBin' = $ServiceBin;
};
}
if ((Expand-IcingaZipArchive -Path $ZipArchive -Destination $ServiceDirectory) -eq $FALSE) {
throw 'Failed to expand the downloaded ZIP archive';
}