mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
added some comments to explain
This commit is contained in:
parent
a7bb5b5ac1
commit
548fc5c71c
5
inxi
5
inxi
|
@ -3405,11 +3405,14 @@ get_distro_data()
|
||||||
if [[ -z $distro ]] && [[ $B_LSB_FILE == 'true' ]];then
|
if [[ -z $distro ]] && [[ $B_LSB_FILE == 'true' ]];then
|
||||||
distro=$( get_distro_lsb_data )
|
distro=$( get_distro_lsb_data )
|
||||||
fi
|
fi
|
||||||
## finally, if all else has failed, give up
|
# now some final null tries
|
||||||
if [[ -z $distro ]];then
|
if [[ -z $distro ]];then
|
||||||
|
# if the file was null but present, which can happen in some cases, then use the file name itself to
|
||||||
|
# set the distro value. Why say unknown if we have a pretty good idea, after all?
|
||||||
if [[ -n $distro_file ]] && [[ " $DISTROS_DERIVED $DISTROS_PRIMARY " == *" $distro_file "* ]];then
|
if [[ -n $distro_file ]] && [[ " $DISTROS_DERIVED $DISTROS_PRIMARY " == *" $distro_file "* ]];then
|
||||||
distro=$( sed -E -e 's/[-_]//' -e 's/(release|version)//' <<< $distro_file | sed -E 's/^([a-z])/\u\1/' )
|
distro=$( sed -E -e 's/[-_]//' -e 's/(release|version)//' <<< $distro_file | sed -E 's/^([a-z])/\u\1/' )
|
||||||
fi
|
fi
|
||||||
|
## finally, if all else has failed, give up
|
||||||
if [[ -z $distro ]];then
|
if [[ -z $distro ]];then
|
||||||
distro='Unknown distro o_O'
|
distro='Unknown distro o_O'
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue