summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2007-09-24 17:38:12 +0200
committerHugues Hiegel <hugues@hiegel.fr>2008-03-07 14:15:18 +0100
commit68f04afba2bfd7570aa9a34ef01b4bc87b0d1fb0 (patch)
treee4890de772e9345bc053c99e0200355cc9a8834b
parent6ffbe42ee3f679c4430782b394f7c4a0db33004c (diff)
Get domain from /etc/resolv.conf if not found elsewhere.
-rw-r--r--.zshrc1
1 files changed, 1 insertions, 0 deletions
diff --git a/.zshrc b/.zshrc
index 503d0d4..e17cdea 100644
--- a/.zshrc
+++ b/.zshrc
@@ -32,6 +32,7 @@ USER=${USER:-`whoami`}
UID=${UID:-`id -u`}
HOST=${HOST:-$(hostname -s)}
DOMAIN=${DOMAIN:-${$(hostname -d 2>&-):-$(hostname -y 2>&-)}}
+[ $DOMAIN = "" -o $DOMAIN = "localdomain" -o $DOMAIN = "(none)" ] && DOMAIN=$(grep "^search " /etc/resolv.conf | cut -d' ' -f2)
DEBUG=no