From 4b264b72791a087d5a283b3bfad25adbaae22f68 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Mon, 19 Oct 2009 10:05:23 +0200 Subject: [Zshrc] some difficulties to get correct domain in some cases... --- zshrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'zshrc') 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} -- cgit v1.2.3