]> err.no Git - dotfiles/commitdiff
Handle domains better
authortfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Thu, 26 Sep 2002 09:46:48 +0000 (09:46 +0000)
committertfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Thu, 26 Sep 2002 09:46:48 +0000 (09:46 +0000)
git-svn-id: file:///svn/tfheen/trunk/dotfiles@28 8da78d58-1cd3-0310-bee5-d77bd1b3e8bf

bashrc

diff --git a/bashrc b/bashrc
index 01ac138f2578be37978c1316478ef85cb81382cb..817062b4c7cd0ae35e26bf4db645818d371571d2 100644 (file)
--- 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.
         ;;
     *)