From 6024b3b38793e36e3ec1b185ca40c186944233f8 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Mon, 20 Jun 2011 18:38:23 +0000 Subject: [PATCH] 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 --- inxi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/inxi b/inxi index e04a5a2..4e260c0 100755 --- a/inxi +++ b/inxi @@ -7410,7 +7410,12 @@ print_system_data() fi if [[ $B_SHOW_HOST == 'true' ]];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 host_string="${C1}Host${C2} $host_name " system_data=$( create_print_line "System:" "${C1}Host${C2} $host_name ${C1}Kernel${C2}" )