mirror of
https://github.com/smxi/inxi.git
synced 2025-01-31 18:12:21 +00:00
(Change Version)
Trying out defaulting to /etc/lsb-release unless it's mint in /etc/issue, that gives more accurate readouts
This commit is contained in:
parent
881628d7f0
commit
6003c8a002
8
inxi
8
inxi
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 0.5.8
|
#### version: 0.5.9
|
||||||
#### Date: November 10 2008
|
#### Date: November 10 2008
|
||||||
########################################################################
|
########################################################################
|
||||||
#### inxi is a fork of infobash, the original bash sys info script by locsmif
|
#### inxi is a fork of infobash, the original bash sys info script by locsmif
|
||||||
|
@ -1050,6 +1050,9 @@ get_distro_data()
|
||||||
distro=$( remove_erroneous_chars "/etc/$distro_file" )
|
distro=$( remove_erroneous_chars "/etc/$distro_file" )
|
||||||
# otherwise try the default debian/ubuntu /etc/issue file
|
# otherwise try the default debian/ubuntu /etc/issue file
|
||||||
elif [[ -f /etc/issue ]];then
|
elif [[ -f /etc/issue ]];then
|
||||||
|
if [[ -f /etc/lsb-release && -z $( grep -i 'mint' /etc/issue ) ]];then
|
||||||
|
distro=$( get_distro_lsb_data )
|
||||||
|
else
|
||||||
distro=$( gawk '
|
distro=$( gawk '
|
||||||
BEGIN { RS="" } {
|
BEGIN { RS="" } {
|
||||||
gsub(/\\[a-z]/, "")
|
gsub(/\\[a-z]/, "")
|
||||||
|
@ -1059,6 +1062,7 @@ get_distro_data()
|
||||||
print
|
print
|
||||||
}' /etc/issue )
|
}' /etc/issue )
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ${#distro} -gt 80 && $B_HANDLE_CORRUPT_DATA != 'true' ]];then
|
if [[ ${#distro} -gt 80 && $B_HANDLE_CORRUPT_DATA != 'true' ]];then
|
||||||
distro="${RED}/etc/${distro_file} corrupted, use -% to override${NORMAL}"
|
distro="${RED}/etc/${distro_file} corrupted, use -% to override${NORMAL}"
|
||||||
|
@ -1105,7 +1109,7 @@ get_distro_lsb_data()
|
||||||
distroCodename = $NF
|
distroCodename = $NF
|
||||||
}
|
}
|
||||||
END {
|
END {
|
||||||
print distroId " " distroRelease " (" distroCodename ")"
|
print distroId " " distroRelease " " distroCodename
|
||||||
}' /etc/lsb-release )
|
}' /etc/lsb-release )
|
||||||
fi
|
fi
|
||||||
# this is HORRIBLY slow, but I don't know why, it runs fast in shell
|
# this is HORRIBLY slow, but I don't know why, it runs fast in shell
|
||||||
|
|
Loading…
Reference in a new issue