From 2d5637e7c5db24f8db737298bfcd177e89a513bf Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Tue, 6 Nov 2012 12:43:37 +0100 Subject: [PATCH] Add profile-sshagent --- dotfiles/profile-sshagent | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 dotfiles/profile-sshagent diff --git a/dotfiles/profile-sshagent b/dotfiles/profile-sshagent new file mode 100644 index 0000000..39f5aba --- /dev/null +++ b/dotfiles/profile-sshagent @@ -0,0 +1,19 @@ +# Add "source $HOME/.profile-sshagent" to your .profile + +SSH_AGENT_FILE=~/.ssh/ssh-agent-info-$(hostname) +if [ -f "$SSH_AGENT_FILE" ]; then + source "$SSH_AGENT_FILE" > /dev/null +fi +if [ ! -w "$SSH_AUTH_SOCK" ]; then + /usr/bin/ssh-agent -s > "$SSH_AGENT_FILE" && \ + source "$SSH_AGENT_FILE" > /dev/null +fi + + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh -- 2.39.5