Permalink
Browse files

bashrc: Reorganize logic for cache_ssh_key()

One should be able to add multiple keys to be associated with
a single $SSH_AUTH_SOCK.
  • Loading branch information...
1 parent d7b1e8d commit 9a251ca1760570bd609b0dc6739bc68aaf22a911 @tommystanton committed Mar 16, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 .bashrc
View
@@ -8,14 +8,15 @@ fi
# User specific aliases and functions
cache_ssh_key () {
- # Cache password for private key
if [ -z "$SSH_AUTH_SOCK" ]; then
eval $(/usr/bin/ssh-agent -s)
- /usr/bin/ssh-add "$@"
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

0 comments on commit 9a251ca

Please sign in to comment.