Skip to content
Snippets Groups Projects
Commit 21e91024 authored by Claus-Justus Heine's avatar Claus-Justus Heine
Browse files

Use SSH_AGENT_PID if set, otherwise try to use a matching socket from /tmp

parent 8777288b
No related branches found
No related tags found
No related merge requests found
...@@ -11,8 +11,8 @@ SNAPSHOTDIR=/hosts/www/www/htdocs/IAM/homepages/claus/download/alberta/snapshots ...@@ -11,8 +11,8 @@ SNAPSHOTDIR=/hosts/www/www/htdocs/IAM/homepages/claus/download/alberta/snapshots
NSNAPSHOTS=10 # keep only the most recent 10 snapshots NSNAPSHOTS=10 # keep only the most recent 10 snapshots
# Pray that we have a running ssh-agent (and only one ...) # Pray that we have a running ssh-agent (and only one ...)
SSH_AGENT_PID=`ps -u claus |grep ssh-agent|awk '{ print $1; }'` : ${SSH_AGENT_PID=`ps -u claus |grep ssh-agent|awk '{ print $1; }'`}
SSH_AUTH_SOCK=`find /tmp -user claus -name "agent.[0-9]*"` : ${SSH_AUTH_SOCK=`find /tmp -user claus -name "agent.[0-9]*"`}
export SSH_AGENT_PID SSH_AUTH_SOCK export SSH_AGENT_PID SSH_AUTH_SOCK
if test -z "${SSH_AGENT_PID}" -o -z "${SSH_AUTH_SOCK}"; then if test -z "${SSH_AGENT_PID}" -o -z "${SSH_AUTH_SOCK}"; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment