From fa9fb946c42e84de2768289e3637af4ab8326374 Mon Sep 17 00:00:00 2001 From: James Blair Date: Sun, 1 Mar 2020 16:32:34 +1300 Subject: [PATCH] Added ssh identity handling. --- .bashrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.bashrc b/.bashrc index ad8ef60..b3f3efb 100644 --- a/.bashrc +++ b/.bashrc @@ -71,6 +71,10 @@ else export SSH_AUTH_SOCK=$(find /tmp/ssh-* -name agent.*) fi +# If ssh-agent has no identities, add mine +ssh-add -l &>/dev/null +if [ "$?" == 1 ]; then ssh-add ~/.ssh/$USER; fi + # Remove bitwarden sessions older than a day if [[ $(find ~/.bw_session -mtime +1 -print) ]]; then rm ~/.bw_session; fi