[zsh] remove warning using -a option of hostname

This commit is contained in:
Mathieu Maret 2011-06-09 14:00:04 +02:00
parent 8747c4dba6
commit 4aed928574

8
.zshrc
View File

@ -37,11 +37,17 @@ USER=${USER:-`whoami`}
UID=${UID:-`id -u`} UID=${UID:-`id -u`}
HOST=$HOST:r HOST=$HOST:r
HOST=${HOST:-$(hostname -s)} HOST=${HOST:-$(hostname -s)}
DOMAIN=${DOMAIN:-$(hostname -a | sed 's/^[^\.]*\.\?//')} DOMAIN=${DOMAIN:-$(hostname -a 2>&-| sed 's/^[^\.]*\.\?//')}
DOMAIN=${DOMAIN:-$(hostname -d 2>&-)} DOMAIN=${DOMAIN:-$(hostname -d 2>&-)}
DOMAIN=${DOMAIN:-$(hostname -y 2>&-)} DOMAIN=${DOMAIN:-$(hostname -y 2>&-)}
[ "$DOMAIN" = "" -o "$DOMAIN" = "localdomain" -o "$DOMAIN" = "(none)" ] && DOMAIN=$(grep "^search " /etc/resolv.conf | cut -d' ' -f2) [ "$DOMAIN" = "" -o "$DOMAIN" = "localdomain" -o "$DOMAIN" = "(none)" ] && DOMAIN=$(grep "^search " /etc/resolv.conf | cut -d' ' -f2)
## Agent de clefs SSH/GPG
KEYCHAIN=~/.keychain/$(hostname)-sh
[ -r "${KEYCHAIN}" ] && source ${KEYCHAIN}
[ -r "${KEYCHAIN}-gpg" ] && source ${KEYCHAIN}-gpg
DEBUG=${DEBUG:-no} DEBUG=${DEBUG:-no}
export USER HOST DOMAIN UID export USER HOST DOMAIN UID