From abeaf6cfa21547700f00966150cd6fc049402051 Mon Sep 17 00:00:00 2001 From: llathasa-veleth Date: Sat, 19 Jun 2021 22:34:01 +0300 Subject: [PATCH] Fixed hostname layer. 1.23 --- disfetch | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/disfetch b/disfetch index 8323459..9b0e3e4 100755 --- a/disfetch +++ b/disfetch @@ -33,6 +33,13 @@ l="\x1B[1m" # bold text ########################################### # getting needed information # ########################################### +# getting hostname +if [ -f /etc/hostname ]; +then + HOSTNAME=$(cat /etc/hostname) +else + HOSTNAME=$(uname -n) +fi # getting OS name if [ -f /etc/os-release ]; then @@ -438,7 +445,7 @@ esac ########################################### # adding only existing layers to info # ########################################### - INFO+=("$motif$(whoami)$r @ $motif$(cat /etc/hostname)$r") + INFO+=("$motif$(whoami)$r @ $motif$HOSTNAME$r") [[ $OS ]] && INFO+=("${motif}OS:$r $OS") [[ $KERNEL ]] && INFO+=("${motif}KERNEL:$r $KERNEL") [[ $ARCH ]] && INFO+=("${motif}ARCH:$r $ARCH")