diff options
Diffstat (limited to 'ssh-agent-setup.sh')
-rw-r--r-- | ssh-agent-setup.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ssh-agent-setup.sh b/ssh-agent-setup.sh new file mode 100644 index 0000000..8b2ab98 --- /dev/null +++ b/ssh-agent-setup.sh @@ -0,0 +1,8 @@ +# 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) |