Ensure a noop if we have an ssh-agent environment configured.

This commit is contained in:
Scott Wallace 2015-09-29 19:49:49 +01:00
parent 8fd9f6a8e3
commit 56e206ab74

View file

@ -88,6 +88,8 @@ function start_agent {
/usr/bin/ssh-add ~/.ssh/scott_dsa /usr/bin/ssh-add ~/.ssh/scott_dsa
} }
# Check if we already have an agent running and sourced
if [ -z "${SSH_AUTH_SOCK}" ]; then
# Source SSH settings, if applicable # Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null . "${SSH_ENV}" > /dev/null
@ -97,6 +99,7 @@ if [ -f "${SSH_ENV}" ]; then
else else
start_agent start_agent
fi fi
fi
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
[ -f ~/.bashrc_local ] && source ~/.bashrc_local [ -f ~/.bashrc_local ] && source ~/.bashrc_local