mirror of https://github.com/CISOfy/lynis.git
DisplayError can now use an optional exit code to quit the program
This commit is contained in:
parent
f436a59c5f
commit
8ee6cb42a3
|
@ -533,13 +533,17 @@
|
|||
# Name : DisplayError()
|
||||
# Description : Show error on screen
|
||||
#
|
||||
# Input : $1 = text (string)
|
||||
# Input : $1 = text (string), $2 = optional exit code (integer)
|
||||
# Returns : <nothing>
|
||||
################################################################################
|
||||
|
||||
DisplayError() {
|
||||
EXITCODE=""
|
||||
if [ $# -gt 1 ]; then EXITCODE=$2; fi
|
||||
${ECHOCMD} ""
|
||||
${ECHOCMD} "${WARNING}Error${NORMAL}: ${BOLD}$1${NORMAL}"
|
||||
${ECHOCMD} ""
|
||||
if [ ! -z "${EXITCODE}" ]; then ExitCustom ${EXITCODE}; fi
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue