Improved ssh-agent check

The old test does not work if an ssh-agent is running but has no identities loaded. This works and is much cleaner.
This commit is contained in:
Benjamin Krueger 2014-01-22 17:40:46 -08:00
commit 87f7098dd4

View file

@ -27,7 +27,7 @@ if ! gpg-connect-agent --quiet /bye > /dev/null 2> /dev/null; then
# check again if another agent is running using the newly sourced settings
if ! gpg-connect-agent --quiet /bye > /dev/null 2> /dev/null; then
# check for existing ssh-agent
if ssh-add -l > /dev/null 2> /dev/null; then
if [[ -n $SSH_AUTH_SOCK ]]; then
# ssh-agent running, start gpg-agent without ssh support
start_agent_nossh;
else