From db4d40e3e782c65363fd29e45cf44fd36a663789 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 10 Oct 2021 22:35:32 +0100 Subject: [PATCH] fix(info): resolve distroversionrh error for some non English languages (#3607) --- lgsm/functions/info_distro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index d8f5dfaca..43a6aa4e0 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -36,7 +36,7 @@ for distro_info in "${distro_info_array[@]}"; do distroname="$(grep "PRETTY_NAME" /etc/os-release | awk -F\= '{gsub(/"/,"",$2);print $2}')" distroversion="$(grep "VERSION_ID" /etc/os-release | awk -F\= '{gsub(/"/,"",$2);print $2}')" # Special var for rhel like distros to removed point in number e.g 8.4 to just 8. - distroversionrh="$(printf "%.0f\n" "${distroversion}")" + distroversionrh="$(sed -nr 's/^VERSION_ID="([0-9]*).+?"/\1/p' /etc/os-release)" distroid="$(grep "ID=" /etc/os-release | grep -v _ID | awk -F\= '{gsub(/"/,"",$2);print $2}')" distroidlike="$(grep "ID_LIKE=" /etc/os-release | grep -v _ID | awk -F\= '{gsub(/"/,"",$2);print $2}')" distrocodename="$(grep "VERSION_CODENAME" /etc/os-release | awk -F\= '{gsub(/"/,"",$2);print $2}')"