diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-21 22:10:08 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-21 22:10:08 +1200 |
commit | 1c792276fafe1f1c8a0d7ebbf103fabfc9a1e132 (patch) | |
tree | 2a1412d7c7a65e9eb31f413652787cd5836ed595 /sh/profile.d | |
parent | Many stylistic fixes/optimisations (diff) | |
download | dotfiles-1c792276fafe1f1c8a0d7ebbf103fabfc9a1e132.tar.gz dotfiles-1c792276fafe1f1c8a0d7ebbf103fabfc9a1e132.zip |
Distill/fix keychain handling a bit
Diffstat (limited to 'sh/profile.d')
-rw-r--r-- | sh/profile.d/keychain.sh | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sh/profile.d/keychain.sh b/sh/profile.d/keychain.sh index 55306ad4..e5d46a41 100644 --- a/sh/profile.d/keychain.sh +++ b/sh/profile.d/keychain.sh @@ -1,17 +1,12 @@ # ssh-askpass setup -if command -v ssh-askpass >/dev/null 2>&1 ; then - SSH_ASKPASS=$(command -v ssh-askpass) +[ -n "${SSH_ASKPASS:="$(command -v ssh-askpass 2>&1)"}" ] && export SSH_ASKPASS -fi # keychain setup if command -v keychain >/dev/null 2>&1 ; then - eval "$(TERM=${TERM:-ansi} keychain \ - --eval --ignore-missing --quiet id_dsa id_rsa id_ecsda)" - # Set and export TTY/GPG_TTY for interactive shells - if [ -t 0 ] ; then - GPG_TTY=$(tty) - export GPG_TTY - fi + # Run keychain as quickly and quietly as possible + eval "$(TERM=${TERM:-ansi} keychain \ + --eval --ignore-missing --quick --quiet \ + id_dsa id_rsa id_ecsda)" fi |