summaryrefslogtreecommitdiff
path: root/zshrc
diff options
context:
space:
mode:
authorHugues Hiegel <hugues.hiegel@openwide.fr>2009-10-19 11:24:54 +0200
committerHugues Hiegel <hugues.hiegel@openwide.fr>2009-10-19 11:24:54 +0200
commit13b40aef113ec97dab079082a7fdfea3c1087552 (patch)
tree03c5c0024be1d4de627088ab44ea40b2eb5a12d5 /zshrc
parent6959f63851876645ef358f2777e7cdff2e8eec93 (diff)
[Zshrc] DOMAIN guessing correction
Diffstat (limited to 'zshrc')
-rw-r--r--zshrc2
1 files changed, 1 insertions, 1 deletions
diff --git a/zshrc b/zshrc
index fca9507..618451f 100644
--- a/zshrc
+++ b/zshrc
@@ -34,7 +34,7 @@ USER=${USER:-`whoami`}
UID=${UID:-`id -u`}
HOST=$HOST:r
HOST=${HOST:-$(hostname -s)}
-DOMAIN=${DOMAIN:-$(hostname -a | cut -d. -f2-)}
+DOMAIN=${DOMAIN:-$(hostname -a | sed 's/^[^\.]*\.\?//')}
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)