mirror of
https://github.com/Burnett01/rsync-deployments.git
synced 2024-11-24 00:13:46 +01:00
15 lines
No EOL
290 B
Bash
15 lines
No EOL
290 B
Bash
#!/bin/sh
|
|
|
|
if [ ! -z "$SSH_AGENT_PID" ]; then
|
|
echo "Var Set"
|
|
ssh-agent -k
|
|
exit $?
|
|
elif [ -f "/tmp/ssh-agent-id" ]; then
|
|
echo "File Exists"
|
|
SSH_AGENT_PID=$(cat /tmp/ssh-agent-id)
|
|
ssh-agent -k
|
|
exit $?
|
|
else
|
|
echo "SSH_AGENT_PID not set, /tmp/ssh-agent-id doesn't exist!" 1>&2
|
|
exit 1
|
|
fi |