From f5e839ef95abdf0b427ce175a058bf733894ff73 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Tue, 8 Mar 2011 00:10:56 +0000 Subject: [PATCH] Use a new ssh-agent only when the user doesn't have any keys added to the current agent. --- SparkleShare/sparkleshare.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SparkleShare/sparkleshare.in b/SparkleShare/sparkleshare.in index 9a577661..979be606 100644 --- a/SparkleShare/sparkleshare.in +++ b/SparkleShare/sparkleshare.in @@ -16,7 +16,11 @@ start() { echo -n "Starting SparkleShare... " mkdir -p /tmp/sparkleshare/ - if [ -n "$SSH_AGENT_PID" ]; then + + # Use a new ssh-agent if the user doesn't have any unlocked keys added + # already. This prevents password prompts of various kinds from appearing. + ssh-add -l > /dev/null + if [ $? == 0 ]; then mono "@expanded_libdir@/@PACKAGE@/SparkleShare.exe" $2 & else ssh-agent mono "@expanded_libdir@/@PACKAGE@/SparkleShare.exe" $2 & @@ -59,5 +63,4 @@ case $1 in *) echo "Usage: sparkleshare {start|stop|restart|help}" ;; -esac - +esac \ No newline at end of file