Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: tommystanton/dotfiles
base: 511755d37c
...
head fork: tommystanton/dotfiles
compare: 9a251ca176
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 16, 2012
@tommystanton bashrc: Enable and clean up cache_ssh_key() 30d0a4a
@tommystanton bashrc: Feedback if ssh key caching is not done 825365a
@tommystanton Revert "bashrc: Feedback if ssh key caching is not done"
This reverts commit b0a23c90b0905c60f7e73ed7d22e5fd659f89944.
d7b1e8d
@tommystanton bashrc: Reorganize logic for cache_ssh_key()
One should be able to add multiple keys to be associated with
a single $SSH_AUTH_SOCK.
9a251ca
Showing with 11 additions and 7 deletions.
  1. +11 −7 .bashrc
View
18 .bashrc
@@ -7,13 +7,17 @@ fi
# User specific aliases and functions
-## TODO Consider http://blog.endpoint.com/2011/02/gnu-screen-sshauthsock-my-new-approach.html
-## Cache password for private key
-#if [ -z "$SSH_AUTH_SOCK" -a -x "$SSH_AGENT" ]; then
-# eval $(/usr/bin/ssh-agent -s)
-# /usr/bin/ssh-add
-# trap "kill $SSH_AGENT_PID" 0
-#fi
+cache_ssh_key () {
+ if [ -z "$SSH_AUTH_SOCK" ]; then
+ eval $(/usr/bin/ssh-agent -s)
+ trap "kill $SSH_AGENT_PID" 0 && \
+ echo "ssh-agent (PID ${SSH_AGENT_PID}) will be killed" \
+ "when this shell is exited"
+ fi
+
+ # Cache password for private key
+ /usr/bin/ssh-add "$@"
+}
# Use perlbrew for a locally-installed perl (see
# http://beta.metacpan.org/module/App::perlbrew)

No commit comments for this range

Something went wrong with that request. Please try again.