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>2019-08-20 15:18:15 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2019-08-20 15:18:15 +0300
commitc1c23a4cca3116d18e196198176ff9f6b0490a1a (patch)
tree386e767f0f3c04491cb79ffd354b408c39626074 /lynis
parente7d6aaa44dd8189cab5d0d001c93864b1ecb0005 (diff)
Only test if we have locale command, which is not always available (like Alpine in Docker container)
Diffstat (limited to 'lynis')
-rwxr-xr-xlynis8
1 files changed, 4 insertions, 4 deletions
diff --git a/lynis b/lynis
index eb05bf9e..29c28919 100755
--- a/lynis
+++ b/lynis
@@ -213,14 +213,14 @@
#
# Auto detection of language based on shell LANG variable. This is required by the Display() function to deal with multi-bytes characters.
DISPLAY_LANG="${LANG:-}"
- # Try locale command if shell variable had no value
- if [ -z "${DISPLAY_LANG}" ]; then
- DISPLAY_LANG=$(locale | egrep "^LANG=" | cut -d= -f2)
- fi
# Extract the short notation of the language (first two characters).
if [ -x "$(command -v locale 2> /dev/null)" ]; then
LANGUAGE=$(locale | egrep "^LANG=" | cut -d= -f2 | cut -d_ -f1 | egrep "^[a-z]{2}$")
+ # Try locale command if shell variable had no value
+ if [ -z "${DISPLAY_LANG}" ]; then
+ DISPLAY_LANG=$(locale | egrep "^LANG=" | cut -d= -f2)
+ fi
fi
# Set default language: 'en' (English) if no value is set