Skip to content

Instantly share code, notes, and snippets.

@calvindavis
Created November 13, 2018 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calvindavis/17979d8d62b29151ad898fc96615591d to your computer and use it in GitHub Desktop.
Save calvindavis/17979d8d62b29151ad898fc96615591d to your computer and use it in GitHub Desktop.
SSH_ENV=$HOME/.ssh/environment
# start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."
# spawn ssh-agent
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add
}
if [ -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
# added by travis gem
[ -f C:/Users/calvin.davis/.travis/travis.sh ] && source C:/Users/calvin.davis/.travis/travis.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment