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:
authorMichael Boelen <michael.boelen@cisofy.com>2016-10-15 11:43:45 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-10-15 11:43:45 +0300
commit7dd3c27b975ec7eb54d27a62206275fb4915b26f (patch)
tree69e1775207ddeeced9ccca546600863099c34cfa
parent32711e415578987cafafa1b0fab926e1f70f5fab (diff)
Improvements for macOS
-rw-r--r--include/osdetection12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/osdetection b/include/osdetection
index c65d602c..dfc95c68 100644
--- a/include/osdetection
+++ b/include/osdetection
@@ -42,11 +42,19 @@
OS="MacOS"
if [ -x /usr/bin/sw_vers ]; then
OS_NAME=$(/usr/bin/sw_vers -productName)
+ if [ "${OS_NAME}" = "Mac OS X" ]; then OS_NAME="macOS"; fi
OS_VERSION=$(/usr/bin/sw_vers -productVersion)
+ case ${OS_VERSION} in
+ 10.9) OS_VERSION="Mavericks" ;;
+ 10.10) OS_VERSION="Yosemite" ;;
+ 10.11) OS_VERSION="El Capitan" ;;
+ 10.12) OS_VERSION="Sierra" ;;
+ *) echo "Unknown macOS version. Do you know what version it is? Share at ${PROGRAM_SOURCE}" ;;
+ esac
OS_FULLNAME="${OS_NAME} ${OS_VERSION}"
else
# Fall back to a fairly safe name
- OS_NAME="Mac OS X"
+ OS_NAME="macOS"
OS_FULLNAME=$(uname -s -r)
OS_VERSION=$(uname -r)
fi
@@ -400,7 +408,7 @@
case ${OS} in
"AIX") ECHOCMD="echo" ;;
"DragonFly"|"FreeBSD"|"NetBSD") ECHOCMD="echo -e"; ECHONB="echo -n" ;;
- "MacOS") ECHOCMD="echo"; ECHONB="echo -n" ;;
+ "MacOS") ECHOCMD="echo"; ECHONB="/bin/echo -n" ;;
"Solaris") ECHOCMD="echo" ;;
"Linux")
# Check if dash is used (Debian/Ubuntu)