Last active
January 31, 2018 09:46
-
-
Save paulmr/fd3328f4f1019232e0b3725c7ad7669a to your computer and use it in GitHub Desktop.
run ssh agent or connect to exisiting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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