dotfiles/.config/zsh/1-ssh-agent-autoconfiguration

15 lines
459 B
Text
Raw Normal View History

2019-02-24 12:28:35 +00:00
if [[ ! -f $ZSH_CONFIG_DIR/scripts/ssh-find-agent.sh ]]; then
print_dbg "No ssh-find-agent.sh script available but required by 1-ssh-agent-autoconfiguration.\n"
return
fi
2019-02-24 12:28:35 +00:00
source $ZSH_CONFIG_DIR/scripts/ssh-find-agent.sh
# Automatically add ssh-agent to any new ssh connection
ssh-find-agent -a
if [ -z "$SSH_AUTH_SOCK" ]
then
eval $(ssh-agent) > /dev/null
ssh-add -l >/dev/null || alias ssh='ssh-add -l >/dev/null || ssh-add && unalias ssh; ssh'
2019-02-24 12:28:35 +00:00
fi