(Change Version)

This should be about it, some fine tuning of variables, distro id handling, and lsb file handling
This commit is contained in:
inxi-svn 2008-11-11 20:01:36 +00:00
parent e158276f5e
commit a761abbda7

21
inxi
View file

@ -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