Add check exitcode scripts from opsi wiki for a better logline in the opsi logs
This commit is contained in:
29
sample/All/CLIENT_DATA/check_nullsoft-exitcode.opsiscript
Normal file
29
sample/All/CLIENT_DATA/check_nullsoft-exitcode.opsiscript
Normal file
@@ -0,0 +1,29 @@
|
||||
;Request ExitCode from last Program
|
||||
set $ExitCode$ = getLastExitCode
|
||||
|
||||
;Modify Loglevel
|
||||
setLogLevel = 4
|
||||
|
||||
;Check ExitCode
|
||||
|
||||
if ($ExitCode$ = "0")
|
||||
setLogLevel = 5
|
||||
comment "ExitCode = "+$ExitCode$+" Normal execution (no error)"
|
||||
setLogLevel = 4
|
||||
endif
|
||||
|
||||
if ($ExitCode$ = "1")
|
||||
setLogLevel = 5
|
||||
logError "ExitCode = "+$ExitCode$+" Installation aborted by user (cancel button)"
|
||||
isFatalError
|
||||
endif
|
||||
|
||||
if ($ExitCode$ = "2")
|
||||
setLogLevel = 5
|
||||
logError "ExitCode = "+$ExitCode$+" Installation aborted by script"
|
||||
isFatalError
|
||||
endif
|
||||
|
||||
;Modify Loglevel
|
||||
setLogLevel = 6
|
||||
|
||||
Reference in New Issue
Block a user