Skip to content

Commit

Permalink
Fix path building for firewall rules
Browse files Browse the repository at this point in the history
[#73] Fixed path building on some Windows Systems for Icinga Agent Firewall rules
  • Loading branch information
LordHepipud committed Mar 6, 2018
1 parent c3c6339 commit 4d4264b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Icinga2Agent/Icinga2Agent.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1149,8 +1149,9 @@ function Icinga2AgentModule {
}
}

[string]$binaryPath = Join-Path $this.getInstallPath() -ChildPath 'sbin\icinga2.exe';
[string]$argument = 'advfirewall firewall add rule'
$argument += [string]::Format(' dir=in action=allow program="{0}sbin\icinga2.exe"', $this.getInstallPath());
$argument += [string]::Format(' dir=in action=allow program="{0}"', $binaryPath);
$argument += ' name="Icinga 2 Agent Inbound by PS-Module"';
$argument += ' description="Inbound Firewall Rule to allow Icinga 2 masters/satellites to connect to the Icinga 2 Agent installed on this system."';
$argument += ' enable=yes';
Expand Down

0 comments on commit 4d4264b

Please sign in to comment.