From b6bf061549113bad6823c34e7e05b91c0fa335d6 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 23 Nov 2015 14:29:12 -0200 Subject: Check for keychain --- profile.dot.link | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/profile.dot.link b/profile.dot.link index 6e5393c..b271b2a 100644 --- a/profile.dot.link +++ b/profile.dot.link @@ -125,15 +125,18 @@ eval "`dircolors -b ~/.dircolorsrc`" # SSH and GPG Agents if [ -e "$HOME/.ssh/id_rsa" ]; then - mkdir -p $HOME/.keychain - /usr/bin/keychain -q $HOME/.ssh/id_rsa - if [ -e "$HOME/.keychain/$HOSTNAME-sh" ]; then - . $HOME/.keychain/$HOSTNAME-sh - fi + if [ -x '/usr/bin/keychain' ]; then + mkdir -p $HOME/.keychain + /usr/bin/keychain -q $HOME/.ssh/id_rsa + + if [ -e "$HOME/.keychain/$HOSTNAME-sh" ]; then + . $HOME/.keychain/$HOSTNAME-sh + fi - if [ -e "$HOME/.keychain/$HOSTNAME-sh-gpg" ]; then - . $HOME/.keychain/$HOSTNAME-sh-gpg + if [ -e "$HOME/.keychain/$HOSTNAME-sh-gpg" ]; then + . $HOME/.keychain/$HOSTNAME-sh-gpg + fi fi #if [ -e "$HOME/apps/scripts/ssh-agent-eval" ]; then -- cgit v1.2.3