From: tfheen Date: Thu, 26 Sep 2002 09:46:48 +0000 (+0000) Subject: Handle domains better X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82dd75c41568cc5f7716873f3774979ad739e508;p=dotfiles Handle domains better git-svn-id: file:///svn/tfheen/trunk/dotfiles@28 8da78d58-1cd3-0310-bee5-d77bd1b3e8bf --- diff --git a/bashrc b/bashrc index 01ac138..817062b 100644 --- a/bashrc +++ b/bashrc @@ -19,11 +19,16 @@ export CVSROOT=~/data/cvs export EDITOR=/usr/bin/emacs export TZ=CET -if which domainname 2>&1 >/dev/null; then - DOMAIN=`domainname` -elif which hostname 2>&1 >/dev/null; then - DOMAIN=`hostname -d` -fi +case `uname -s` in + *BSD) + HOSTNAME=`hostname` + DOMAINNAME=`hostname | cut -d. -f 2-` + ;; + Linux) + HOSTNAME=`hostname -f` + DOMAINNAME=`hostmame -f | cut -d. -f 2-` + ;; +esac LS_OPTIONS="$LS_OPTIONS -B" @@ -52,8 +57,8 @@ export PILOTRATE=115200 export PILOTPORT=/dev/tts/0 alias mirror="wget --mirror --no-parent --convert-links -P $HOME/data/www-mirror " -case "$DOMAIN" in - pvv) +case "$DOMAINNAME" in + pvv*) # Sigh, no locale here, at least not uniformly. ;; *)