Skip to content

Instantly share code, notes, and snippets.

@UserAd
Created February 16, 2011 16:55
Show Gist options
  • Save UserAd/829712 to your computer and use it in GitHub Desktop.
Save UserAd/829712 to your computer and use it in GitHub Desktop.
declare -x LANG="ru_RU.UTF-8"
SSH_AGENT_PID=`ps x| grep ssh-agent | grep -v grep | awk '{print $1}'`;
if [ -n "$SSH_AGENT_PID" ]; then
export SSH_AGENT_PID;
SSH_AUTH_SOCK=/tmp/`ls --co=never /tmp | grep ssh`;
SSH_AUTH_SOCK=$SSH_AUTH_SOCK/`ls --co=never $SSH_AUTH_SOCK`;
export SSH_AUTH_SOCK;
else
eval `ssh-agent`;
ssh-add ~/.ssh/identity;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment