Simplify keychain call for SSH

This commit is contained in:
Jeremy Gardais 2019-02-19 18:06:16 +01:00
parent dfb7d0f727
commit 6b2f00d4f0
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 6 additions and 4 deletions

10
zlogin
View File

@ -77,15 +77,17 @@ if [ ${USER} != "root" ] && [ $(command -v startx) ]; then
fi fi
fi fi
# Keychain {{{
## TODO: user must be able to see ssh-agent process
## Be careful with hidepid!
if [ -f $HOME/.ssh/id_rsa ]; then if [ -f $HOME/.ssh/id_rsa ]; then
[[ ! -f ~/.keychain/$HOST-sh ]] && keychain --agents ssh id_rsa eval $(keychain --eval --quiet --agents ssh id_rsa)
source ~/.keychain/$HOST-sh
fi fi
if [ -f $HOME/.ssh/id_ed25519 ]; then if [ -f $HOME/.ssh/id_ed25519 ]; then
[[ ! -f ~/.keychain/$HOST-sh ]] && keychain --agents ssh id_ed25519 eval $(keychain --eval --quiet --agents ssh id_ed25519)
source ~/.keychain/$HOST-sh
fi fi
# }}}
# GPG Agent # GPG Agent
if [ -f $HOME/.gnupg/secring.gpg ]; then if [ -f $HOME/.gnupg/secring.gpg ]; then