aboutsummaryrefslogtreecommitdiff
path: root/mkshrc
diff options
context:
space:
mode:
Diffstat (limited to 'mkshrc')
-rw-r--r--mkshrc5
1 files changed, 4 insertions, 1 deletions
diff --git a/mkshrc b/mkshrc
index 3d78f8c..606154b 100644
--- a/mkshrc
+++ b/mkshrc
@@ -368,7 +368,10 @@ checkSSHAgent() {
if [ -e "$ssh_agent_conf" ] ; then
. "$ssh_agent_conf"
fi
- if ! ps -eo pid | grep -q "$SSH_AGENT_PID" ; then
+ if ! ps -eo pid | grep -q "$SSH_AGENT_PID" \
+ || ! [ -e "$ssh_agent_conf" ] \
+ || [ -z "$SSH_AGENT_PID" ] ; \
+ then
ssh-agent -s | grep -v echo > "$ssh_agent_conf"
. "$ssh_agent_conf"
fi