From d4b445c3162a890ec750c6742e08ecf23d4f8dca Mon Sep 17 00:00:00 2001 From: mboelen Date: Thu, 18 Sep 2014 22:22:11 +0200 Subject: [PATCH] Check Linux kernel version and properly display short version --- include/osdetection | 3 ++- lynis | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/osdetection b/include/osdetection index c0e44ca5..890e1b89 100644 --- a/include/osdetection +++ b/include/osdetection @@ -106,7 +106,8 @@ HARDWARE=`uname -m` HOMEDIRS="/home" FIND_BINARIES="whereis -b" - OS_KERNELVERSION=`uname -r` + OS_KERNELVERSION_FULL=`uname -r` + OS_KERNELVERSION=`echo ${OS_KERNELVERSION_FULL} | sed 's/-.*//'` # Amazon if [ -e "/etc/system-release" ]; then diff --git a/lynis b/lynis index 9ab200dc..b4b55369 100755 --- a/lynis +++ b/lynis @@ -504,6 +504,9 @@ logtext "Operating system version: ${OS_VERSION}" if [ ! "${OS_MODE}" = "" ]; then logtext "Operating system mode: ${OS_MODE}"; fi logtext "Kernel version: ${OS_KERNELVERSION}" + if [ ! "${OS_KERNELVERSION_FULL}" = "" ]; then + logtext "Kernel version (full): ${OS_KERNELVERSION_FULL}" + fi logtext "Hardware platform: ${HARDWARE}" logtext "Virtual machine: ${VMFULLTYPE}" logtext "Hostname: ${HOSTNAME}"