dotfiles/zsh/ssh-agent.zsh

8 lines
249 B
Bash
Raw Normal View History

2016-01-23 00:58:21 +00:00
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'