dotfiles/zsh/ssh-agent.zsh
2016-01-23 13:58:21 +13:00

7 lines
249 B
Bash

if ! pgrep -u $USER ssh-agent > /dev/null; then
ssh-agent > ~/.ssh-agent-thing
fi
if [[ "$SSH_AGENT_PID" == "" ]]; then
eval $(<~/.ssh-agent-thing)
fi
ssh-add -l >/dev/null || alias ssh='ssh-add -l >/dev/null || ssh-add && unalias ssh; ssh'