Fixed ssh-agent plugin when ssh-add is not in /usr/bin/ssh-add

This commit is contained in:
Cary M. Robbins 2014-10-08 07:27:03 +02:00
commit 840167afd6

View file

@ -45,7 +45,13 @@ function _plugin__start_agent()
zstyle -a :omz:plugins:ssh-agent identities identities
echo starting ssh-agent...
/usr/bin/ssh-add $HOME/.ssh/${^identities}
if [ $(command -v ssh-add 2>/dev/null) ]; then
SSH_ADD=ssh-add
else
SSH_ADD=/usr/bin/ssh-add
fi
$SSH_ADD $HOME/.ssh/${^identities}
}
# Get the filename to store/lookup the environment from