diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2016-07-12 21:32:15 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2016-07-12 21:32:15 +0300 |
commit | 07a113e46ec10a93aa86bac680ab95a5e539840c (patch) | |
tree | 2072be166a3723772487f5614b804b877cd1e464 /lynis | |
parent | cb76421d9c462947006ec3d6f15fbb29c5c45b84 (diff) |
Set initial value for language and improve auto detection
Diffstat (limited to 'lynis')
-rwxr-xr-x | lynis | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 # ################################################################################# # |