From 3e8e445dfc78583394da89c89e6e1e8f9b3c79a5 Mon Sep 17 00:00:00 2001 From: Alexander Tratsevskiy Date: Fri, 24 Jun 2022 12:45:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B7=D0=BD=D0=B0=D1=87=D0=B8?= =?UTF-8?q?=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D0=B0=D1=8F=20=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2_ac_install_merge/app-shells/bash/bashrc.d/prompt.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/profiles/templates/3.6/2_ac_install_merge/app-shells/bash/bashrc.d/prompt.sh b/profiles/templates/3.6/2_ac_install_merge/app-shells/bash/bashrc.d/prompt.sh index ba24bd9a2..19644b915 100644 --- a/profiles/templates/3.6/2_ac_install_merge/app-shells/bash/bashrc.d/prompt.sh +++ b/profiles/templates/3.6/2_ac_install_merge/app-shells/bash/bashrc.d/prompt.sh @@ -7,9 +7,12 @@ if [[ $- != *i* ]] ; then fi if ${use_color} ; then - PS_HOSTNAME=$(timeout 0.5 hostname -f 2>/dev/null | sed -r "s/(\.[^.]+)?\.[^.]+$//") - if [[ -z $PS_HOSTNAME ]] + PS_HOSTNAME=$(timeout 0.5 hostname -f 2>/dev/null) + if [[ $PS_HOSTNAME ]] then + PS_HOSTNAME=${PS_HOSTNAME%.*} + PS_HOSTNAME=${PS_HOSTNAME%.*} + else PS_HOSTNAME="$(hostname)" fi if [[ ${EUID} == 0 ]] ; then