summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2009-10-19 10:05:23 +0200
committerHugues Hiegel <hugues@hiegel.fr>2009-10-19 10:05:23 +0200
commit4b264b72791a087d5a283b3bfad25adbaae22f68 (patch)
tree4176f4918aa72e55dd81fea742f76a492b2494c9
parentebd48b2b0cc326a55e4ca167c5b6ad4e890c3c02 (diff)
[Zshrc] some difficulties to get correct domain in some cases...
-rw-r--r--zshrc4
1 files changed, 3 insertions, 1 deletions
diff --git a/zshrc b/zshrc
index 657a810..fca9507 100644
--- a/zshrc
+++ b/zshrc
@@ -34,7 +34,9 @@ USER=${USER:-`whoami`}
UID=${UID:-`id -u`}
HOST=$HOST:r
HOST=${HOST:-$(hostname -s)}
-DOMAIN=${DOMAIN:-${$(hostname -d 2>&-):-$(hostname -y 2>&-)}}
+DOMAIN=${DOMAIN:-$(hostname -a | cut -d. -f2-)}
+DOMAIN=${DOMAIN:-$(hostname -d 2>&-)}
+DOMAIN=${DOMAIN:-$(hostname -y 2>&-)}
[ "$DOMAIN" = "" -o "$DOMAIN" = "localdomain" -o "$DOMAIN" = "(none)" ] && DOMAIN=$(grep "^search " /etc/resolv.conf | cut -d' ' -f2)
DEBUG=${DEBUG:-no}