mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Prepared module for running as daemon
This commit is contained in:
parent
c67bfab206
commit
59be230567
1 changed files with 19 additions and 0 deletions
|
|
@ -11,9 +11,28 @@
|
|||
|
||||
function Use-Icinga()
|
||||
{
|
||||
param(
|
||||
[switch]$LibOnly = $FALSE,
|
||||
[switch]$Daemon = $FALSE
|
||||
);
|
||||
|
||||
# This function will allow us to load this entire module including possible
|
||||
# actions, making it available within our shell environment
|
||||
Import-IcingaLib '\' -Init;
|
||||
|
||||
if ($LibOnly -eq $FALSE) {
|
||||
$global:IcingaThreads = [hashtable]::Synchronized(@{});
|
||||
$global:IcingaThreadContent = [hashtable]::Synchronized(@{});
|
||||
$global:IcingaThreadPool = [hashtable]::Synchronized(@{});
|
||||
$global:IcingaDaemonData = [hashtable]::Synchronized(
|
||||
@{
|
||||
'IcingaThreads' = $global:IcingaThreads;
|
||||
'IcingaThreadContent' = $global:IcingaThreadContent;
|
||||
'IcingaThreadPool' = $global:IcingaThreadPool;
|
||||
'FrameworkRunningAsDaemon' = $Daemon;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function Import-IcingaLib()
|
||||
|
|
|
|||
Loading…
Reference in a new issue