Skip to content

Commit 714827b

Browse files
committed
Adds script termination in case Agent is not installed for Agent Binary fetching
1 parent 401ac2e commit 714827b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/core/icingaagent/getters/Get-IcingaAgentBinary.psm1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
function Get-IcingaAgentBinary()
22
{
33
$IcingaRootDir = Get-IcingaAgentRootDirectory;
4+
if ([string]::IsNullOrEmpty($IcingaRootDir)) {
5+
throw 'The Icinga Agent seems not to be installed';
6+
}
7+
48
$IcingaBinary = (Join-Path -Path $IcingaRootDir -ChildPath '\sbin\icinga2.exe');
59

610
if ((Test-Path $IcingaBinary) -eq $FALSE) {

0 commit comments

Comments
 (0)