From 57987314141b08231fda4e20f9ea9e3040faa4cd Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Fri, 7 Oct 2022 08:19:35 -0500 Subject: [PATCH] .bash_profile: Register id_ed25519 SSH key with ssh-agent, if present --- .bash_profile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.bash_profile b/.bash_profile index 1122b04..be7ef93 100644 --- a/.bash_profile +++ b/.bash_profile @@ -14,9 +14,13 @@ fi keychain=$(type -P keychain) test -n "$keychain" && \ test -z "$SUDO_USER" && { - if [ -f ~/.ssh/id_rsa ]; then - eval `$keychain -q ~/.ssh/id_rsa` + ids="" + test -f ~/.ssh/id_rsa && ids="$ids id_rsa" + test -f ~/.ssh/id_ed25519 && ids="$ids id_ed25519" + if [ -n "$ids" ]; then + eval `$keychain -q $ids` source ~/.keychain/`hostname`-sh > /dev/null fi + unset ids } unset keychain -- 2.43.0