Skip to content

Commit 970b998

Browse files
committed
WIP
1 parent a5f0f60 commit 970b998

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
function Clear-IcingaInternalServiceInformation()
2+
{
3+
$Global:Icinga.Protected.ServiceRestartLock = $FALSE;
4+
$Global:Icinga.Protected.IcingaServiceUser = '';
5+
$Global:Icinga.Protected.IfWServiceUser = '';
6+
$Global:Icinga.Protected.IcingaServiceState = '';
7+
$Global:Icinga.Protected.IfWServiceState = '';
8+
}

lib/core/installer/Install-Icinga.psm1

+5-5
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function Install-Icinga()
7070
$JsonInstallCmd = ConvertFrom-Json -InputObject $InstallCommand -ErrorAction Stop;
7171
} catch {
7272
Write-IcingaConsoleError 'Failed to deserialize the provided JSON from file or command: {0}' -Objects $_.Exception.Message;
73-
$Global:Icinga.Protected.ServiceRestartLock = $FALSE;
73+
Clear-IcingaInternalServiceInformation;
7474
return;
7575
}
7676

@@ -84,7 +84,7 @@ function Install-Icinga()
8484
$Success = Invoke-IcingaForWindowsManagementConsoleCustomConfig -IcingaConfiguration $IcingaConfiguration;
8585

8686
if ($Success -eq $FALSE) {
87-
$Global:Icinga.Protected.ServiceRestartLock = $FALSE;
87+
Clear-IcingaInternalServiceInformation;
8888
return;
8989
}
9090

@@ -105,7 +105,7 @@ function Install-Icinga()
105105
$Success = Invoke-IcingaForWindowsManagementConsoleCustomConfig -IcingaConfiguration $IcingaConfiguration;
106106

107107
if ($Success -eq $FALSE) {
108-
$Global:Icinga.Protected.ServiceRestartLock = $FALSE;
108+
Clear-IcingaInternalServiceInformation;
109109
return;
110110
}
111111

@@ -116,7 +116,7 @@ function Install-Icinga()
116116
# Set our "old" swap live again. By doing so, we can still continue our old
117117
# configuration
118118
Set-IcingaPowerShellConfig -Path 'Framework.Config.Swap' -Value $OldConfigSwap;
119-
$Global:Icinga.Protected.ServiceRestartLock = $FALSE;
119+
Clear-IcingaInternalServiceInformation;
120120
return;
121121
}
122122

@@ -191,7 +191,7 @@ function Install-Icinga()
191191
}
192192
}
193193

194-
$Global:Icinga.Protected.ServiceRestartLock = $FALSE;
194+
Clear-IcingaInternalServiceInformation;
195195

196196
if ($null -ne (Get-Command -Name 'Set-IcingaForWindowsManagementConsoleClosing' -ErrorAction SilentlyContinue)) {
197197
Set-IcingaForWindowsManagementConsoleClosing -Completed;

0 commit comments

Comments
 (0)