Skip to content

Instantly share code, notes, and snippets.

@paulmr
Last active January 31, 2018 09:46
Show Gist options
  • Save paulmr/fd3328f4f1019232e0b3725c7ad7669a to your computer and use it in GitHub Desktop.
Save paulmr/fd3328f4f1019232e0b3725c7ad7669a to your computer and use it in GitHub Desktop.
run ssh agent or connect to exisiting
AGENT_DATA_PATH=~/.ssh/agent-data
function s {
. $AGENT_DATA_PATH
if ssh-add -l >/dev/null 2>&1
then
true
else
echo "not running"
ssh-agent >$AGENT_DATA_PATH
. $AGENT_DATA_PATH
ssh-add
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment