Adds script termination in case Agent is not installed for Agent Binary fetching

This commit is contained in:
Christian Stein 2020-02-13 10:19:23 +01:00
parent 401ac2ed53
commit 714827bc0a

View file

@ -1,6 +1,10 @@
function Get-IcingaAgentBinary()
{
$IcingaRootDir = Get-IcingaAgentRootDirectory;
if ([string]::IsNullOrEmpty($IcingaRootDir)) {
throw 'The Icinga Agent seems not to be installed';
}
$IcingaBinary = (Join-Path -Path $IcingaRootDir -ChildPath '\sbin\icinga2.exe');
if ((Test-Path $IcingaBinary) -eq $FALSE) {