Browse Source

OS codename

Ernesto Nicolás Carrea 5 years ago
parent
commit
ac9c8d69e3
1 changed files with 4 additions and 1 deletions
  1. 4 1
      func/osal.sh

+ 4 - 1
func/osal.sh

@@ -8,14 +8,17 @@ case "$OS_TYPE" in
 debian)
 debian)
     OS_BASE='debian'
     OS_BASE='debian'
     OS_VERSION=$(cat /etc/debian_version|grep -o "[0-9]\{1,2\}"|head -n1)
     OS_VERSION=$(cat /etc/debian_version|grep -o "[0-9]\{1,2\}"|head -n1)
+    OS_CODENAME="$(cat /etc/os-release |grep VERSION= |cut -f 2 -d \(|cut -f 1 -d \))"
     ;;
     ;;
 ubuntu)
 ubuntu)
     OS_BASE='debian'
     OS_BASE='debian'
-    OS_VERSION="$(lsb_release -s -r)"
+    OS_VERSION="$(lsb_release -s -r)".
+    OS_CODENAME="$(lsb_release -s -c)"
     ;;
     ;;
 centos|rhel|fedora|redhat)
 centos|rhel|fedora|redhat)
     OS_BASE='rhel'
     OS_BASE='rhel'
     OS_VERSION=$(cat /etc/os-release | grep VERSION_ID | sed -e "s/VERSION_ID=//" | sed -e 's/^"//' -e 's/"$//')
     OS_VERSION=$(cat /etc/os-release | grep VERSION_ID | sed -e "s/VERSION_ID=//" | sed -e 's/^"//' -e 's/"$//')
+    OS_CODENAME=''
     ;;
     ;;
 *)
 *)
     OS_BASE='unknown'
     OS_BASE='unknown'