mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Don't start ssh_agent is SSH_AUTH_SOCK is set
OSX and Gnome use their own agent
This commit is contained in:
parent
142c03dbd2
commit
b481acdc0a
1 changed files with 8 additions and 7 deletions
|
|
@ -10,14 +10,15 @@ function start_agent {
|
|||
/usr/bin/ssh-add;
|
||||
}
|
||||
|
||||
# Source SSH settings, if applicable
|
||||
function has_agent {
|
||||
[ -n "${SSH_AUTH_SOCK}" ] && [ -r "${SSH_AUTH_SOCK}" ]
|
||||
return $?
|
||||
}
|
||||
|
||||
if [ -f "${SSH_ENV}" ]; then
|
||||
if ! has_agent && [ -f "${SSH_ENV}" ] ; then
|
||||
. ${SSH_ENV} > /dev/null
|
||||
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
|
||||
start_agent;
|
||||
}
|
||||
else
|
||||
start_agent;
|
||||
fi
|
||||
|
||||
if ! has_agent ; then
|
||||
start_agent
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue