From 6003c8a0020fd9d5163d64a2605af6d473968afd Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Tue, 11 Nov 2008 07:01:29 +0000 Subject: [PATCH] (Change Version) Trying out defaulting to /etc/lsb-release unless it's mint in /etc/issue, that gives more accurate readouts --- inxi | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/inxi b/inxi index 14a9cf7..4f995ae 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.5.8 +#### version: 0.5.9 #### Date: November 10 2008 ######################################################################## #### inxi is a fork of infobash, the original bash sys info script by locsmif @@ -1050,14 +1050,18 @@ get_distro_data() distro=$( remove_erroneous_chars "/etc/$distro_file" ) # otherwise try the default debian/ubuntu /etc/issue file elif [[ -f /etc/issue ]];then - distro=$( gawk ' - BEGIN { RS="" } { - gsub(/\\[a-z]/, "") - gsub(/,/, " ") - gsub(/^ +| +$/, "") - gsub(/ [ \t]+/, " ") - print - }' /etc/issue ) + if [[ -f /etc/lsb-release && -z $( grep -i 'mint' /etc/issue ) ]];then + distro=$( get_distro_lsb_data ) + else + distro=$( gawk ' + BEGIN { RS="" } { + gsub(/\\[a-z]/, "") + gsub(/,/, " ") + gsub(/^ +| +$/, "") + gsub(/ [ \t]+/, " ") + print + }' /etc/issue ) + fi fi if [[ ${#distro} -gt 80 && $B_HANDLE_CORRUPT_DATA != 'true' ]];then @@ -1105,7 +1109,7 @@ get_distro_lsb_data() distroCodename = $NF } END { - print distroId " " distroRelease " (" distroCodename ")" + print distroId " " distroRelease " " distroCodename }' /etc/lsb-release ) fi # this is HORRIBLY slow, but I don't know why, it runs fast in shell