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
diff options
context:
space:
mode:
Diffstat (limited to 'include/osdetection')
-rw-r--r--include/osdetection40
1 files changed, 20 insertions, 20 deletions
diff --git a/include/osdetection b/include/osdetection
index c2726d31..4af35a18 100644
--- a/include/osdetection
+++ b/include/osdetection
@@ -308,31 +308,31 @@
# CPUBuilders Linux
if [ -e "/etc/cpub-release" ]; then OS_FULLNAME=$(cat /etc/cpub-release); fi
- # Debian/Ubuntu (***) - Set first to Debian
- if [ -e "/etc/debian_version" ]; then
+ if [ -z "${LINUX_VERSION}" ] && [ -e "/etc/debian_version" ]; then
+ # Debian/Ubuntu (***) - Set first to Debian
OS_VERSION=$(cat /etc/debian_version)
OS_FULLNAME="Debian ${OS_VERSION}"
LINUX_VERSION="Debian"
- fi
- # /etc/lsb-release does not exist on Debian
- if [ -e "/etc/debian_version" -a -e /etc/lsb-release ]; then
- OS_VERSION=$(cat /etc/debian_version)
- FIND=$(grep "^DISTRIB_ID=" /etc/lsb-release | cut -d '=' -f2 | sed 's/"//g')
- if [ "${FIND}" = "Ubuntu" ]; then
- OS_VERSION=$(grep "^DISTRIB_RELEASE=" /etc/lsb-release | cut -d '=' -f2)
- OS_FULLNAME="Ubuntu ${OS_VERSION}"
- LINUX_VERSION="Ubuntu"
- elif [ "${FIND}" = "elementary OS" ]; then
- LINUX_VERSION="elementary OS"
- OS_VERSION=$(grep "^DISTRIB_RELEASE=" /etc/lsb-release | cut -d '=' -f2)
- OS_FULLNAME=$(grep "^DISTRIB_DESCRIPTION=" /etc/lsb-release | cut -d '=' -f2 | sed 's/"//g')
- else
- # Catch all, in case it's unclear what specific release this is.
- OS_FULLNAME="Debian ${OS_VERSION}"
- LINUX_VERSION="Debian"
+ # /etc/lsb-release does not exist on Debian
+ if [ -e /etc/lsb-release ]; then
+ OS_VERSION=$(cat /etc/debian_version)
+ FIND=$(grep "^DISTRIB_ID=" /etc/lsb-release | cut -d '=' -f2 | sed 's/"//g')
+ if [ "${FIND}" = "Ubuntu" ]; then
+ OS_VERSION=$(grep "^DISTRIB_RELEASE=" /etc/lsb-release | cut -d '=' -f2)
+ OS_FULLNAME="Ubuntu ${OS_VERSION}"
+ LINUX_VERSION="Ubuntu"
+ elif [ "${FIND}" = "elementary OS" ]; then
+ LINUX_VERSION="elementary OS"
+ OS_VERSION=$(grep "^DISTRIB_RELEASE=" /etc/lsb-release | cut -d '=' -f2)
+ OS_FULLNAME=$(grep "^DISTRIB_DESCRIPTION=" /etc/lsb-release | cut -d '=' -f2 | sed 's/"//g')
+ else
+ # Catch all, in case it's unclear what specific release this is.
+ OS_FULLNAME="Debian ${OS_VERSION}"
+ LINUX_VERSION="Debian"
+ fi
+ # Ubuntu test (optional) $(grep "[Uu]buntu" /proc/version)
fi
- # Ubuntu test (optional) $(grep "[Uu]buntu" /proc/version)
fi
# Override for Linux Mint, as that is initially detected as Debian or Ubuntu