From 6cd0b09c0a468f8171e99f283bdda7423b24a2ec Mon Sep 17 00:00:00 2001 From: Hyacinthe Cartiaux Date: Tue, 18 Feb 2014 16:22:31 +0100 Subject: [PATCH] [bash] environment - fix G5K detection --- bash/bash_environment | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bash/bash_environment b/bash/bash_environment index 86d110c..16861df 100644 --- a/bash/bash_environment +++ b/bash/bash_environment @@ -32,12 +32,13 @@ export LANG LANGUAGE LC_CTYPE LC_ALL # Get rid of mail notification unset MAILCHECK -# Configure a set of useful variables for the prompt +# Configure a set of useful variables if [[ "`echo $UNAME | grep -c -i -e '^.*bsd$'`" == "1" ]] ; then - DOMAIN=`hostname | cut -d '.' -f 2` + FQDN=`hostname` else - DOMAIN=`hostname -f | cut -d '.' -f 2` + FQDN=`hostname -f` fi +DOMAIN=`echo $FQDN | cut -d '.' -f 2` # ---------------------------------------------------------------------- # SHELL TYPE @@ -120,7 +121,7 @@ export TSOCKS_CONF_FILE=~/.dotfiles/tsocks/tsocks.conf # GRID5000 specific # ---------------------------------------------------------------------- -if [[ "$DOMAIN" = "luxembourg" ]] ; then +if [[ -n "`echo $FQDN | grep -o .grid5000.fr`" ]] ; then export OAR_JOB_KEY_FILE=~/.ssh/id_rsa export HTTP_PROXY=http://proxy:3128 export HTTPS_PROXY=$HTTP_PROXY