From 6b2f00d4f04c5b8d259399884ed72dbb3f35979a Mon Sep 17 00:00:00 2001 From: Gardouille Date: Tue, 19 Feb 2019 18:06:16 +0100 Subject: [PATCH] Simplify keychain call for SSH --- zlogin | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/zlogin b/zlogin index 5a50043..14b0a6c 100644 --- a/zlogin +++ b/zlogin @@ -77,15 +77,17 @@ if [ ${USER} != "root" ] && [ $(command -v startx) ]; then fi fi +# Keychain {{{ +## TODO: user must be able to see ssh-agent process +## Be careful with hidepid ! if [ -f $HOME/.ssh/id_rsa ]; then - [[ ! -f ~/.keychain/$HOST-sh ]] && keychain --agents ssh id_rsa - source ~/.keychain/$HOST-sh + eval $(keychain --eval --quiet --agents ssh id_rsa) fi if [ -f $HOME/.ssh/id_ed25519 ]; then - [[ ! -f ~/.keychain/$HOST-sh ]] && keychain --agents ssh id_ed25519 - source ~/.keychain/$HOST-sh + eval $(keychain --eval --quiet --agents ssh id_ed25519) fi +# }}} # GPG Agent if [ -f $HOME/.gnupg/secring.gpg ]; then