Fixes debug/daemon mode while loading libs only

This commit is contained in:
Christian Stein 2020-03-25 22:28:54 +01:00
parent 7a732de5f4
commit 90ef20a7e5

View file

@ -53,6 +53,18 @@ function Use-Icinga()
'DebugMode' = $DebugMode; 'DebugMode' = $DebugMode;
} }
); );
} else {
# This will fix the debug mode in case we are only using Libs
# without any other variable content and daemon handling
if ($null -eq $global:IcingaDaemonData) {
$global:IcingaDaemonData = [hashtable]::Synchronized(@{});
}
if ($global:IcingaDaemonData.ContainsKey('DebugMode') -eq $FALSE) {
$global:IcingaDaemonData.DebugMode = $DebugMode;
}
if ($global:IcingaDaemonData.ContainsKey('FrameworkRunningAsDaemon') -eq $FALSE) {
$global:IcingaDaemonData.FrameworkRunningAsDaemon = $Daemon;
}
} }
} }