From 39fa1a269f048da926139d99607bc61232c8f6b3 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Sun, 8 Aug 2010 20:29:39 -0500 Subject: [PATCH] .bash_profile: Support "keychain" Check for existence of keychain and find path to keychain using $PATH. --- .bash_profile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.bash_profile b/.bash_profile index 9974040..5646308 100644 --- a/.bash_profile +++ b/.bash_profile @@ -6,7 +6,11 @@ if [ -f ~/.bashrc ]; then fi # keychain -if [ -f ~/.ssh/id_dsa ]; then - /usr/bin/keychain -q ~/.ssh/id_dsa - source ~/.keychain/`hostname`-sh > /dev/null -fi +keychain="$(type -P keychain)" +test -n "$keychain" && { + if [ -f ~/.ssh/id_dsa ]; then + eval `$keychain -q ~/.ssh/id_dsa` + source ~/.keychain/`hostname`-sh > /dev/null + fi +} +unset keychain -- 2.45.2