Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lynis
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2016-07-12 21:32:15 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-07-12 21:32:15 +0300
commit07a113e46ec10a93aa86bac680ab95a5e539840c (patch)
tree2072be166a3723772487f5614b804b877cd1e464 /lynis
parentcb76421d9c462947006ec3d6f15fbb29c5c45b84 (diff)
Set initial value for language and improve auto detection
Diffstat (limited to 'lynis')
-rwxr-xr-xlynis7
1 files changed, 5 insertions, 2 deletions
diff --git a/lynis b/lynis
index ec1bb961..84989720 100755
--- a/lynis
+++ b/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
#
#################################################################################
#