mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
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:
parent
3839656174
commit
6024b3b387
5
inxi
5
inxi
|
@ -7410,8 +7410,13 @@ 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
|
||||||
|
if [[ -n $( type p hostname ) ]];then
|
||||||
|
host_name=$( hostname )
|
||||||
|
fi
|
||||||
|
if [[ -z $host_name ]];then
|
||||||
host_name='N/A'
|
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}" )
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue