mirror of
https://github.com/Burnett01/rsync-deployments.git
synced 2024-11-23 16:03:46 +01:00
Don't allow agent reloads, if it's running already.
This commit is contained in:
parent
6cd1d3e4bd
commit
7e8e10f130
1 changed files with 13 additions and 3 deletions
10
agent-start
10
agent-start
|
@ -6,7 +6,17 @@ mkdir -p "$STORE_PATH"
|
|||
|
||||
# Start the SSH agent if it isn't already.
|
||||
if [ -z "$SSH_AGENT_PID" ]; then
|
||||
if [ -f "$STORE_PATH/id" ]; then
|
||||
# Our auth agent is already running.
|
||||
# Reload the vars, and export them.
|
||||
SSH_AGENT_PID=$(cat "$STORE_PATH/id")
|
||||
export SSH_AGENT_PID
|
||||
|
||||
SSH_AUTH_SOCK=$(cat "$STORE_PATH/sock")
|
||||
export SSH_AUTH_SOCK
|
||||
else
|
||||
eval "$(ssh-agent)" > /dev/null
|
||||
echo "$SSH_AGENT_PID" > "$STORE_PATH"/id
|
||||
echo "$SSH_AUTH_SOCK" > "$STORE_PATH"/sock
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue