From: Mike Frysinger Date: Tue, 12 Aug 2014 14:19:06 +0000 (-0400) Subject: split ssh-agent & gpg-agent loading X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=5176a509beccabdbe30cbd3420580dea441b12bb;p=home.git split ssh-agent & gpg-agent loading --- diff --git a/.profile.d/keychain.sh b/.profile.d/keychain.sh index 14a6289..7f0ef65 100644 --- a/.profile.d/keychain.sh +++ b/.profile.d/keychain.sh @@ -1,9 +1,12 @@ # If an auth sock is already set & available, use it. # This way ssh agent forwarding still works. -if [ ! -S "${SSH_AUTH_SOCK}" ] ; then - if type keychain >/dev/null 2>&1 ; then +if type keychain >/dev/null 2>&1 ; then + if [ ! -S "${SSH_AUTH_SOCK}" ] ; then : ${HOSTNAME:=$(hostname)} [ -e ~/.keychain/${HOSTNAME}-sh ] && . ~/.keychain/${HOSTNAME}-sh + fi + if [ -z "${GPG_AGENT_INFO}" ] ; then + : ${HOSTNAME:=$(hostname)} [ -e ~/.keychain/${HOSTNAME}-sh-gpg ] && . ~/.keychain/${HOSTNAME}-sh-gpg fi fi