From 1915b9bdbf9f54894bb8692fec3a64c4ff9e37d6 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Thu, 25 Jan 2024 20:29:19 -0500 Subject: [PATCH] Manage ssh-add in .zshrc --- fake_home/.zshrc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fake_home/.zshrc b/fake_home/.zshrc index 4b78ba4..4a2b8ba 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -2,6 +2,14 @@ if test -f /usr/share/doc/fzf/examples/completion.zsh &> /dev/null; then source /usr/share/doc/fzf/examples/completion.zsh fi +ssh_ids=$(find "$HOME/.ssh" -type f -name "id*" | grep -v '\.pub') +if [[ "$ssh_ids" != "" ]]; then + eval "$(ssh-agent -s)" &> /dev/null + for id in $(echo $ssh_ids); do + ssh-add "$id" &> /dev/null + done +fi + HISTFILE=~/.histfile HISTSIZE=SAVEHIST=100000000 setopt appendhistory autocd notify