File tree 2 files changed +15
-7
lines changed
2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,13 @@ function Exit-IcingaThrowCritical()
25
25
Set-IcingaInternalPluginExitCode - ExitCode $IcingaEnums.IcingaExitCode.Critical ;
26
26
Set-IcingaInternalPluginException - PluginException $OutputMessage ;
27
27
28
- if ($Global :Icinga.Protected.RunAsDaemon -eq $FALSE -And $Global :Icinga.Protected.JEAContext -eq $FALSE ) {
29
- Write-IcingaConsolePlain $OutputMessage ;
30
- exit $IcingaEnums.IcingaExitCode.Critical ;
28
+ if ($Global :Icinga.Protected.RunAsDaemon -eq $TRUE -Or $Global :Icinga.Protected.JEAContext -eq $TRUE ) {
29
+ throw $OutputMessage ;
30
+
31
+ # Just in case we don't end - shouldn't happen anyway
32
+ return ;
31
33
}
34
+
35
+ Write-IcingaConsolePlain $OutputMessage ;
36
+ exit $IcingaEnums.IcingaExitCode.Critical ;
32
37
}
Original file line number Diff line number Diff line change @@ -110,10 +110,13 @@ function Exit-IcingaThrowException()
110
110
Set-IcingaInternalPluginExitCode - ExitCode $IcingaEnums.IcingaExitCode.Unknown ;
111
111
Set-IcingaInternalPluginException - PluginException $OutputMessage ;
112
112
113
- if ($Global :Icinga.Protected.RunAsDaemon -eq $FALSE -And $Global :Icinga.Protected.JEAContext -eq $FALSE ) {
114
- Write-IcingaConsolePlain $OutputMessage ;
115
- exit $IcingaEnums.IcingaExitCode.Unknown ;
116
- } else {
113
+ if ($Global :Icinga.Protected.RunAsDaemon -eq $TRUE -Or $Global :Icinga.Protected.JEAContext -eq $TRUE ) {
117
114
throw $OutputMessage ;
115
+
116
+ # Just in case we don't end - shouldn't happen anyway
117
+ return ;
118
118
}
119
+
120
+ Write-IcingaConsolePlain $OutputMessage ;
121
+ exit $IcingaEnums.IcingaExitCode.Unknown ;
119
122
}
You can’t perform that action at this time.
0 commit comments