From 2e3416053417e330bb06f450f25b0c2685b67cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Fri, 10 Oct 2014 10:21:44 +0800 Subject: [PATCH] Fix exit code for 10_ssh-agent --- bash/bashrc/sources/09_ssh-agent | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bash/bashrc/sources/09_ssh-agent b/bash/bashrc/sources/09_ssh-agent index 3b21ced..40ec3c9 100755 --- a/bash/bashrc/sources/09_ssh-agent +++ b/bash/bashrc/sources/09_ssh-agent @@ -8,7 +8,15 @@ function start_agent { echo succeeded chmod 600 "${SSH_ENV}" . "${SSH_ENV}" > /dev/null + + # Test the ssh-add if status return 0/1, agent is initialized /usr/bin/ssh-add; + ST=$? + if [ $ST -ne 0 ] && [ $ST -ne 1 ]; then + return $ST + fi + + return 0 } # Source SSH settings, if applicable