From ce6acdf1c15b39b8c85cf8f18cca31790ffab55e Mon Sep 17 00:00:00 2001 From: Julien Dufresne Date: Thu, 7 Sep 2017 10:47:42 +0200 Subject: [PATCH] Display hostname instead of short version The previous command `host -TtA "$(hostname -s)"` were taking too long. Moreover, using the short version of the hostname may not be enough on some cases so roll back to the classic output of the `hostname` method. --- source/tools/hostname.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source/tools/hostname.sh b/source/tools/hostname.sh index 80b8fa6..cb3e0db 100644 --- a/source/tools/hostname.sh +++ b/source/tools/hostname.sh @@ -4,9 +4,6 @@ function get_hostname { declare -n _hostname="$1" - _hostname="$(host -TtA "$(hostname -s)"|grep "has address"|awk '{ print $1 }')" - if [[ "$_hostname" = "" ]] - then - _hostname="$(hostname -s)" - fi + _hostname="$(hostname)" } +