Skip to content

Instantly share code, notes, and snippets.

@omkensey
Last active April 19, 2018 13:24
Show Gist options
  • Save omkensey/77558548eaf380ccbe661e45b0bf017f to your computer and use it in GitHub Desktop.
Save omkensey/77558548eaf380ccbe661e45b0bf017f to your computer and use it in GitHub Desktop.
if [ -f ~/.ssh-agent ] && [ /dev/console -nt ~/.ssh-agent ]; then
rm -f ~/.ssh-agent
echo "Deleted old agent environment file."
fi
if [ ! -f ~/.ssh-agent ]; then
echo "Starting agent."
ssh-agent > ~/.ssh-agent
fi
source ~/.ssh-agent > /dev/null 2>&1
if ! ssh-add -l > /dev/null 2>&1 ; then
ssh-add
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment