# Starts the ssh-agent if it is not running, and either way sources the required environment variables. if [ -z "$(ps -e | grep ssh-agent)" ]; then # ssh-agent does not seem to be running, start it ssh-agent | sed -r '/echo Agent pid [0-9]+;/d' > ~/.sshsession fi eval $(<~/.sshsession)