mirror of https://github.com/CISOfy/lynis.git
Set initial value for language and improve auto detection
This commit is contained in:
parent
cb76421d9c
commit
07a113e46e
|
@ -33,13 +33,12 @@ compressed-uploads=yes
|
|||
# Show non-zero exit code when warnings are found
|
||||
error-on-warnings=no
|
||||
|
||||
# Use Lynis in your own language (available languages: en fr nl)
|
||||
language=en
|
||||
# Use Lynis in your own language (by default auto-detected)
|
||||
language=
|
||||
|
||||
# Add your Lynis Enterprise license key here
|
||||
# Lynis Enterprise license key
|
||||
license-key=
|
||||
|
||||
|
||||
# Defines the role of the system (desktop, server)
|
||||
machine-role=server
|
||||
|
||||
|
|
|
@ -139,7 +139,9 @@
|
|||
# Language
|
||||
language | lang)
|
||||
LogText "Language set via profile to ${VALUE}"
|
||||
LANGUAGE="${VALUE}"
|
||||
if [ ! -z "${VALUE}" ]; then
|
||||
LANGUAGE="${VALUE}"
|
||||
fi
|
||||
AddSetting "language" "${LANGUAGE}" "Language"
|
||||
;;
|
||||
|
||||
|
|
7
lynis
7
lynis
|
@ -99,8 +99,11 @@ Make sure to execute ${PROGRAM_NAME} from untarred directory or check your insta
|
|||
fi
|
||||
|
||||
# Auto detection of language based on locale (first two characters). Set to English when nothing found.
|
||||
LANGUAGE=$(locale | egrep "^LANG=" | cut -d= -f2 | cut -d_ -f1)
|
||||
if [ "${LANGUAGE}" = "" ]; then LANGUAGE="en"; fi
|
||||
LANGUAGE=$(locale | egrep "^LANG=" | cut -d= -f2 | cut -d_ -f1 | egrep "^[a-z]{2}$")
|
||||
if [ -z "${LANGUAGE}" ]; then
|
||||
#Debug "Result: no (valid) language found, setting to default language (en)"
|
||||
LANGUAGE="en"
|
||||
fi
|
||||
#
|
||||
#################################################################################
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue