mirror of
https://github.com/Burnett01/rsync-deployments.git
synced 2025-06-18 23:03:01 -06:00
Add path support, to allow multiple agents to run (ie gitlab)
This commit is contained in:
parent
d8263c4260
commit
e09a929e60
2 changed files with 38 additions and 11 deletions
12
agent-start
12
agent-start
|
@ -1,7 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
STORE_PATH=/tmp
|
||||
if [ ! -z "$1" ]; then
|
||||
# This allows us to work with things like gitlab.
|
||||
# where the same thing might be running concurrently.
|
||||
# If default, it only stores in /tmp/, but if a path is added, it's interpolated.
|
||||
STORE_PATH="$STORE_PATH/$1"
|
||||
mkdir -p "$STORE_PATH"
|
||||
fi
|
||||
|
||||
# Start the SSH agent if it isn't already.
|
||||
if [ -z "$SSH_AGENT_PID" ]; then
|
||||
eval "$(ssh-agent)" > /dev/null
|
||||
echo "$SSH_AGENT_PID" > /tmp/ssh-agent-id
|
||||
echo "$SSH_AGENT_PID" > "$STORE_PATH"/ssh-agent-id
|
||||
echo "$SSH_AUTH_SOCK" > "$STORE_PATH"/ssh-auth-sock
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue