diff --git a/.zshrc b/.zshrc index 06073a0..cb0b1ac 100644 --- a/.zshrc +++ b/.zshrc @@ -17,10 +17,10 @@ # # If you want to make user, host or network specific configurations, # add your specific scripts to the folders -# - "sys:$(uname -s)" for OS-specific conf, -# - "user:$(whoami)" for user-specific conf, -# - "host:$(hostname -s)" for host-specific conf, -# - "net:$(domainname)" for network-specific conf, +# - "sys:$(uname -s)" for OS-specific conf, +# - "user:$(whoami)" for user-specific conf, +# - "host:$(hostname -s)" for host-specific conf, +# - "net:$(domainname)" for network-specific conf, # rename your scripts to the form mentionned above, minus the "??_" # prefix. An original script prefixed by a two-digits number SHOULD # be present on the $ZDOTDIR folder, even if empty. @@ -37,11 +37,17 @@ USER=${USER:-`whoami`} UID=${UID:-`id -u`} HOST=$HOST:r 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 -y 2>&-)} [ "$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} export USER HOST DOMAIN UID