diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2016-10-16 12:57:19 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2016-10-16 12:57:19 +0300 |
commit | 7cc56cf4eab4a94fde921ee84e18c3bd6ed796b6 (patch) | |
tree | 57634ec96753c78347fb4cf7c7ea1825514841ed | |
parent | ae02e81101f9339d64a36584de7cc0ef3d951390 (diff) |
Use ID from /etc/os-release
-rw-r--r-- | include/osdetection | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/osdetection b/include/osdetection index 4e1dfb5d..6e240ab1 100644 --- a/include/osdetection +++ b/include/osdetection @@ -123,16 +123,16 @@ # Generic if [ -e /etc/os-release ]; then - FIND=$(grep "^NAME=" /etc/os-release) - if [ ! -z "${FIND}" ]; then - case ${FIND} in - "CoreOS") + OS_ID=$(grep "^ID=" /etc/os-release) + if [ ! -z "${OS_ID}" ]; then + case ${OS_ID} in + "coreos") LINUX_VERSION="CoreOS" OS_FULLNAME=$(grep "^PRETTY_NAME=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_NAME="CoreOS Linux" ;; - "Ubuntu") + "ubuntu") LINUX_VERSION="Ubuntu" OS_FULLNAME=$(grep "^PRETTY_NAME=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') |