Created
July 15, 2022 16:15
-
-
Save derekschrock/9caecb49314eefc6dae69a1fa90eeb8c to your computer and use it in GitHub Desktop.
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
if [[ -f "$SSH_AGENT_FILE" ]]; then | |
source "$SSH_AGENT_FILE" > /dev/null | |
ssh-add -l > /dev/null | |
if [[ "$?" -gt 1 ]]; then | |
if ssh-agent -t "${sshagent_time:-2d}" > "$SSH_AGENT_FILE"; then | |
source "$SSH_AGENT_FILE" > /dev/null | |
else | |
echo "Can't start ssh-agent or write ${SSH_AGENT_FILE}: $?" | |
fi | |
fi | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment