icinga-powershell-framework/lib/core/jea/Get-IcingaJEAServicePid.psm1

12 lines
358 B
PowerShell
Raw Normal View History

2021-08-06 12:12:27 -04:00
function Get-IcingaJEAServicePid()
{
[string]$JeaPidFile = (Join-Path -Path (Get-IcingaCacheDir) -ChildPath 'jea.pid');
[string]$JeaPid = Read-IcingaFileSecure -File $JeaPidFile;
if ([string]::IsNullOrEmpty($JeaPid) -eq $FALSE) {
$JeaPid = $JeaPid.Replace("`r`n", '').Replace("`n", '').Replace(' ', '');
}
return $JeaPid;
}