From a761abbda7db3493229d80313f747ac2b0f3e635 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Tue, 11 Nov 2008 20:01:36 +0000 Subject: [PATCH] (Change Version) This should be about it, some fine tuning of variables, distro id handling, and lsb file handling --- inxi | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/inxi b/inxi index 8e4eec6..bb9b5a5 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.5.14 +#### version: 0.5.15 #### Date: November 11 2008 ######################################################################## #### inxi is a fork of infobash, the original bash sys info script by locsmif @@ -1156,20 +1156,31 @@ get_distro_lsb_data() distro=$( gawk -F '=' ' { IGNORECASE=1 } + # note: adding the spacing directly to variable to make sure distro output is null if not found /^DISTRIB_ID/ { gsub(/^ +| +$/, "", $NF) - distroId = $NF + # this is needed because grep for "arch" is too loose to be safe + if ( $NF = "arch" ) { + distroId = "Arch Linux" + } + else if ( $NF != "n/a" ) { + distroId = $NF " " + } } /^DISTRIB_RELEASE/ { gsub(/^ +| +$/, "", $NF) - distroRelease = $NF + if ( $NF != "n/a" ) { + distroRelease = $NF " " + } } /^DISTRIB_CODENAME/ { gsub(/^ +| +$/, "", $NF) - distroCodename = $NF + if ( $NF != "n/a" ) { + 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