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:
authorDaniel Romell <dromell@users.noreply.github.com>2017-06-21 15:17:49 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2017-06-21 15:17:49 +0300
commit5b12f17e3fc29e07862bd2e60d8680fdd07cba1d (patch)
treeb86b3458dfd04eeee80ffd047ce83608cd5b2764 /lynis
parentac2c83870bdefd98ed4c54d53eaa0cb35c6dbfb9 (diff)
Minor fixes for embedded Linux. (#406)
* Check if the "locale" binary is available before using it. This is no functional change as it will still fall back to english when the locale can't be determined. This fix gets rid of the following error when running on systems without the locale binary: ./lynis: line 112: locale: command not found Signed-off-by: Daniel Romell <daro@hms.se> * tests_kernel: KRNL-5677: Fix invalid use of shell test. This fixes an issue (syntax error) triggered on systems with no PAE or NX extensions: - Checking CPU support (NX/PAE) /usr/libexec/lynis/include/tests_kernel: line 126: [: too many arguments /usr/libexec/lynis/include/tests_kernel: line 132: [: too many arguments No need to use [] when only looking at function return values. Signed-off-by: Daniel Romell <daro@hms.se>
Diffstat (limited to 'lynis')
-rwxr-xr-xlynis4
1 files changed, 3 insertions, 1 deletions
diff --git a/lynis b/lynis
index ab81fd1e..4b804b5c 100755
--- a/lynis
+++ b/lynis
@@ -109,7 +109,9 @@ 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 | egrep "^[a-z]{2}$")
+ if [ -x "$(command -v locale)" ]; then
+ LANGUAGE=$(locale | egrep "^LANG=" | cut -d= -f2 | cut -d_ -f1 | egrep "^[a-z]{2}$")
+ fi
if [ -z "${LANGUAGE}" ]; then
#Debug "Result: no (valid) language found, setting to default language (en)"
LANGUAGE="en"