Manage ssh-add in .zshrc

This commit is contained in:
Sage Vaillancourt 2024-01-25 20:29:19 -05:00
parent 90972c478f
commit 1915b9bdbf
1 changed files with 8 additions and 0 deletions

View File

@ -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