From 21e910247c002e1f13a95449b8c28705c0dcff57 Mon Sep 17 00:00:00 2001 From: Claus-Justus Heine <Claus-Justus.Heine@IANS.Uni-Stuttgart.DE> Date: Fri, 8 Jun 2007 12:47:22 +0000 Subject: [PATCH] Use SSH_AGENT_PID if set, otherwise try to use a matching socket from /tmp --- mksnap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mksnap.sh b/mksnap.sh index 8aed89a..843427b 100755 --- a/mksnap.sh +++ b/mksnap.sh @@ -11,8 +11,8 @@ SNAPSHOTDIR=/hosts/www/www/htdocs/IAM/homepages/claus/download/alberta/snapshots NSNAPSHOTS=10 # keep only the most recent 10 snapshots # Pray that we have a running ssh-agent (and only one ...) -SSH_AGENT_PID=`ps -u claus |grep ssh-agent|awk '{ print $1; }'` -SSH_AUTH_SOCK=`find /tmp -user claus -name "agent.[0-9]*"` +: ${SSH_AGENT_PID=`ps -u claus |grep ssh-agent|awk '{ print $1; }'`} +: ${SSH_AUTH_SOCK=`find /tmp -user claus -name "agent.[0-9]*"`} export SSH_AGENT_PID SSH_AUTH_SOCK if test -z "${SSH_AGENT_PID}" -o -z "${SSH_AUTH_SOCK}"; then -- GitLab