From dfb7d0f7271511abbdca0f9651e7c14e44af91fb Mon Sep 17 00:00:00 2001 From: Gardouille Date: Tue, 19 Feb 2019 15:14:51 +0100 Subject: [PATCH] Launch ssh-agent if source file is unavailable --- zlogin | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zlogin b/zlogin index d1956b6..5a50043 100644 --- a/zlogin +++ b/zlogin @@ -78,13 +78,13 @@ if [ ${USER} != "root" ] && [ $(command -v startx) ]; then fi if [ -f $HOME/.ssh/id_rsa ]; then - keychain --agents ssh id_rsa - . $HOME/.keychain/$HOST-sh + [[ ! -f ~/.keychain/$HOST-sh ]] && keychain --agents ssh id_rsa + source ~/.keychain/$HOST-sh fi if [ -f $HOME/.ssh/id_ed25519 ]; then - keychain --agents ssh id_ed25519 - . $HOME/.keychain/$HOST-sh + [[ ! -f ~/.keychain/$HOST-sh ]] && keychain --agents ssh id_ed25519 + source ~/.keychain/$HOST-sh fi # GPG Agent