From bc94e8e815f9a7133eecd9f76767f2fdbe0e911f Mon Sep 17 00:00:00 2001 From: rht Date: Fri, 20 Dec 2019 16:40:23 -0500 Subject: [PATCH] prod install: Use /etc/os-release for Ubuntu/Debian to get os_id, os_version_id. --- scripts/lib/install | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/scripts/lib/install b/scripts/lib/install index e0d98d997e..72b05606c1 100755 --- a/scripts/lib/install +++ b/scripts/lib/install @@ -99,24 +99,18 @@ export LANG="en_US.UTF-8" export LANGUAGE="en_US.UTF-8" # Check for a supported OS release. -if [ -f /etc/debian_version ]; then - apt-get install -y lsb-release - os_info="$(lsb_release --short --id --release --codename)" - { read -r os_id; read -r os_release; read -r os_version_id; } <<< "$os_info" -elif [ -f /etc/os-release ]; then - os_info="$(. /etc/os-release; printf '%s\n' "$ID" "$VERSION_ID")" - { read -r os_id; read -r os_version_id; } <<< "$os_info" -else - export os_version_id="unsupported" +if [ -f /etc/os-release ]; then + os_info="$(. /etc/os-release; printf '%s\n' "$ID" "$VERSION_ID" "$VERSION_CODENAME")" + { read -r os_id; read -r os_version_id; read -r os_version_codename; } <<< "$os_info" fi -case "$os_version_id" in - xenial|stretch|bionic|buster) ;; +case "$os_id$os_version_id" in + ubuntu16.04|ubuntu18.04|debian9|debian10) ;; *) set +x cat <