adding a fallback to use hostname if $HOSTNAME is null, if all these fail, host name will be set to N/A, which also, as with other uses of

that, serves as a convenient bug reporter for user output
This commit is contained in:
inxi-svn 2011-06-20 18:38:23 +00:00
parent 3839656174
commit 6024b3b387

7
inxi
View file

@ -7410,7 +7410,12 @@ print_system_data()
fi fi
if [[ $B_SHOW_HOST == 'true' ]];then if [[ $B_SHOW_HOST == 'true' ]];then
if [[ -z $HOSTNAME ]];then if [[ -z $HOSTNAME ]];then
host_name='N/A' if [[ -n $( type p hostname ) ]];then
host_name=$( hostname )
fi
if [[ -z $host_name ]];then
host_name='N/A'
fi
fi fi
host_string="${C1}Host${C2} $host_name " host_string="${C1}Host${C2} $host_name "
system_data=$( create_print_line "System:" "${C1}Host${C2} $host_name ${C1}Kernel${C2}" ) system_data=$( create_print_line "System:" "${C1}Host${C2} $host_name ${C1}Kernel${C2}" )