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

14 lines
459 B
Text

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
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'
fi