Explorar el Código

yum can now get centos distroversion

Daniel Gibbs hace 9 años
padre
commit
037d2a9eeb
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      lgsm/functions/info_distro.sh

+ 5 - 1
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