]> git.wh0rd.org - home.git/blob - .profile.d/keychain.sh
cros-board: update
[home.git] / .profile.d / keychain.sh
1 # If an auth sock is already set & available, use it.
2 # This way ssh agent forwarding still works.
3 if type keychain >/dev/null 2>&1 ; then
4 if [ ! -S "${SSH_AUTH_SOCK}" ] ; then
5 : ${HOSTNAME:=$(hostname)}
6 [ -e ~/.keychain/${HOSTNAME}-sh ] && . ~/.keychain/${HOSTNAME}-sh
7 fi
8 if [ -z "${GPG_AGENT_INFO}" ] ; then
9 : ${HOSTNAME:=$(hostname)}
10 [ -e ~/.keychain/${HOSTNAME}-sh-gpg ] && . ~/.keychain/${HOSTNAME}-sh-gpg
11 fi
12 fi
13
14 # The agent might try to spawn pinentry on the tty it started
15 # on instead of the tty gpg is now running on.
16 export GPG_TTY="$(tty)"