mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-23 05:44:45 +02:00
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()
|
# Name : DisplayError()
|
||||||
# Description : Show error on screen
|
# Description : Show error on screen
|
||||||
#
|
#
|
||||||
# Input : $1 = text (string)
|
# Input : $1 = text (string), $2 = optional exit code (integer)
|
||||||
# Returns : <nothing>
|
# Returns : <nothing>
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
DisplayError() {
|
DisplayError() {
|
||||||
|
EXITCODE=""
|
||||||
|
if [ $# -gt 1 ]; then EXITCODE=$2; fi
|
||||||
|
${ECHOCMD} ""
|
||||||
${ECHOCMD} "${WARNING}Error${NORMAL}: ${BOLD}$1${NORMAL}"
|
${ECHOCMD} "${WARNING}Error${NORMAL}: ${BOLD}$1${NORMAL}"
|
||||||
${ECHOCMD} ""
|
${ECHOCMD} ""
|
||||||
|
if [ ! -z "${EXITCODE}" ]; then ExitCustom ${EXITCODE}; fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user