Use ID from /etc/os-release

This commit is contained in:
Michael Boelen 2016-10-16 11:57:19 +02:00
parent ae02e81101
commit 7cc56cf4ea
1 changed files with 5 additions and 5 deletions

View File

@ -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 '"')