From 43cd180f6f0ce9d55032783a1c853617963e5161 Mon Sep 17 00:00:00 2001 From: Hyacinthe Cartiaux Date: Wed, 15 Mar 2017 21:28:14 +0100 Subject: [PATCH] [bash] environment variables, prevent one potential dns request --- bash/bash_environment | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bash/bash_environment b/bash/bash_environment index d38a3ee..117964a 100644 --- a/bash/bash_environment +++ b/bash/bash_environment @@ -33,7 +33,9 @@ export LANG LANGUAGE LC_CTYPE LC_ALL unset MAILCHECK # Configure a set of useful variables -if [[ "$(echo "$UNAME" | grep -c -i -e '^.*bsd$')" == "1" ]] ; then +if [[ -e /proc/sys/kernel/hostname ]] ; then + FQDN=$(cat /proc/sys/kernel/hostname) +elif [[ "$(echo "$UNAME" | grep -c -i -e '^.*bsd$')" == "1" ]] ; then FQDN=$(hostname) else FQDN=$(hostname -f)