Skip to content

Commit

Permalink
Display hostname instead of short version
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
juliendufresne committed Sep 7, 2017
1 parent b691123 commit ce6acdf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions source/tools/hostname.sh
Expand Up @@ -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)"
}

0 comments on commit ce6acdf

Please sign in to comment.