... | ... |
@@ -4,21 +4,20 @@ |
4 | 4 |
local SSH_ENV=$HOME/.ssh/environment |
5 | 5 |
|
6 | 6 |
function start_agent { |
7 |
- /usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV} |
|
8 |
- chmod 600 ${SSH_ENV} |
|
9 |
- . ${SSH_ENV} > /dev/null |
|
10 |
- /usr/bin/ssh-add; |
|
7 |
+ /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV} |
|
8 |
+ chmod 600 ${SSH_ENV} |
|
9 |
+ . ${SSH_ENV} > /dev/null |
|
10 |
+ /usr/bin/ssh-add; |
|
11 | 11 |
} |
12 | 12 |
|
13 | 13 |
# Source SSH settings, if applicable |
14 | 14 |
|
15 | 15 |
if [ -f "${SSH_ENV}" ]; then |
16 |
- . ${SSH_ENV} > /dev/null |
|
17 |
- #ps ${SSH_AGENT_PID} doesn't work under cywgin |
|
18 |
- ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { |
|
19 |
- start_agent; |
|
20 |
- } |
|
16 |
+ . ${SSH_ENV} > /dev/null |
|
17 |
+ ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { |
|
18 |
+ start_agent; |
|
19 |
+ } |
|
21 | 20 |
else |
22 |
- start_agent; |
|
21 |
+ start_agent; |
|
23 | 22 |
fi |
24 | 23 |
|