]> git.wh0rd.org Git - home.git/commitdiff
split ssh-agent & gpg-agent loading
authorMike Frysinger <vapier@gentoo.org>
Tue, 12 Aug 2014 14:19:06 +0000 (10:19 -0400)
committerMike Frysinger <vapier@gentoo.org>
Tue, 12 Aug 2014 14:19:06 +0000 (10:19 -0400)
.profile.d/keychain.sh

index 14a6289858052dfeee897fe159f1ab9ded37fd3b..7f0ef652a39f2d4314f8de4066ad3137ea9bb267 100644 (file)
@@ -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