Automatically grab SSH-agent info if it exists.
authorW. Trevor King <wking@drexel.edu>
Wed, 9 Nov 2011 19:11:23 +0000 (14:11 -0500)
committerW. Trevor King <wking@drexel.edu>
Wed, 9 Nov 2011 19:11:23 +0000 (14:11 -0500)
The key info location is determined by my `ssh-prime.sh` script.  See
my SSH blog post for details [1].

[1]: http://physics.drexel.edu/~wking/unfolding-disasters/posts/SSH/

_bashrc

diff --git a/_bashrc b/_bashrc
index eea4fe4e6e4c6950dd2f33fc233921ce339cca68..3061b15072acc3af182a9ff9fd3ed5365fd11c06 100644 (file)
--- a/_bashrc
+++ b/_bashrc
@@ -174,6 +174,11 @@ if [ -z "$SSH_CLIENT" ]; then
     fi
 fi
 
+SSH_INFO_FILE="/tmp/$(whoami)/.ssh/.ssh-agent-info-$(hostname)"
+if [ -f "$SSH_INFO_FILE" ]; then
+    . "$SSH_INFO_FILE"
+fi
+
 ### ---- begin .dotfiles section ---- (keep this magic comment)
 
 # Check for Git (versioning system) so we know how to get our .dotfiles