only ssh-add if we have keychain running

This commit is contained in:
Joel Beckmeyer 2024-10-28 12:20:55 -04:00
parent 0b4683d3e1
commit a615a24f42

View File

@ -58,7 +58,6 @@ if [[ -n "$WSL_DISTRO_NAME" ]]; then
fi fi
# GPG setup (and SSH) # GPG setup (and SSH)
ssh-add ~/.ssh/id_rsa
# SSH setup # SSH setup
# I finally figured out how to export my id_rsa from GPG using # I finally figured out how to export my id_rsa from GPG using
# https://superuser.com/a/1681454 (copied/summarized here to avoid link rot): # https://superuser.com/a/1681454 (copied/summarized here to avoid link rot):
@ -81,6 +80,7 @@ ssh-add ~/.ssh/id_rsa
if command -v keychain >/dev/null; then if command -v keychain >/dev/null; then
alias keychain="keychain --nolock --absolute --dir $XDG_RUNTIME_DIR" alias keychain="keychain --nolock --absolute --dir $XDG_RUNTIME_DIR"
eval "$(keychain --quick --eval)" eval "$(keychain --quick --eval)"
ssh-add ~/.ssh/id_rsa
fi fi
### End user configuration ### End user configuration