diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2016-10-16 12:55:11 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2016-10-16 12:55:11 +0300 |
commit | ae02e81101f9339d64a36584de7cc0ef3d951390 (patch) | |
tree | e438dadb124e18e19d8569957d6fdc3c29b98676 /include/osdetection | |
parent | fc494a6d3fc97311082a8e1d77d062b122f3dd45 (diff) |
Improve usage of /etc/os-release
Diffstat (limited to 'include/osdetection')
-rw-r--r-- | include/osdetection | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/osdetection b/include/osdetection index 7710349d..4e1dfb5d 100644 --- a/include/osdetection +++ b/include/osdetection @@ -129,11 +129,17 @@ "CoreOS") LINUX_VERSION="CoreOS" OS_FULLNAME=$(grep "^PRETTY_NAME=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') - OS_VERSION=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}') + OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') OS_NAME="CoreOS Linux" ;; + "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 '"') + OS_NAME="Ubuntu Linux" + ;; *) - echo "Unknown OS found in /etc/os-release. Do you know what it is? Create an issue at ${PROGRAM_SOURCE" + Debug "Unknown OS found in /etc/os-release. Do you know what it is? Create an issue at ${PROGRAM_SOURCE}" ;; esac fi |