Statistics
| Branch: | Tag: | Revision:

mininet / util / vm / .bash_profile @ 86af067e

History | View | Annotate | Download (562 Bytes)

1
SSH_ENV="$HOME/.ssh/environment"
2

    
3
function start_agent {
4
     echo "Initialising new SSH agent..."
5
     /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
6
     echo succeeded
7
     chmod 600 "${SSH_ENV}"
8
     . "${SSH_ENV}" > /dev/null
9
     /usr/bin/ssh-add;
10
}
11

    
12
# Source SSH settings, if applicable
13

    
14
if [ -f "${SSH_ENV}" ]; then
15
     . "${SSH_ENV}" > /dev/null
16
     #ps ${SSH_AGENT_PID} doesn't work under cywgin
17
     ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
18
         start_agent;
19
     }
20
else
21
     start_agent;
22
fi
23

    
24
source ~/.bashrc