]> git.sthu.org Git - shutils.git/commitdiff
Add profile-sshagent
authorStefan Huber <s.huber@bct-electronic.com>
Tue, 6 Nov 2012 11:43:37 +0000 (12:43 +0100)
committerStefan Huber <s.huber@bct-electronic.com>
Tue, 6 Nov 2012 11:43:37 +0000 (12:43 +0100)
dotfiles/profile-sshagent [new file with mode: 0644]

diff --git a/dotfiles/profile-sshagent b/dotfiles/profile-sshagent
new file mode 100644 (file)
index 0000000..39f5aba
--- /dev/null
@@ -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