From 037d2a9eeb0dda44df368b6895089f1e2c6cd5aa Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 9 Aug 2016 10:44:07 +0100 Subject: [PATCH] yum can now get centos distroversion --- lgsm/functions/info_distro.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 85801a70d..4f3012730 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -25,7 +25,11 @@ else distroname="$(uname -s) $(uname -r)" fi -distroversion=$(grep VERSION_ID /etc/os-release | tr -cd '[:digit:]') +if [ -f "/etc/os-release" ]; then + distroversion=$(grep VERSION_ID /etc/os-release | tr -cd '[:digit:]') +elif [ -n "$(command -v yum)" ]; then + distroversion=$(rpm -qa \*-release | grep -Ei "oracle|redhat|centos" | cut -d"-" -f3) +fi ## Glibc version # e.g: 1.17