From 609acec16e6a7867b4bcf507096b767fab8a14dd Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 2 Jan 2022 10:01:49 -0600 Subject: Use keychain(1) if available I need to add this to an install list --- profile/ssh-agent.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'profile') diff --git a/profile/ssh-agent.sh b/profile/ssh-agent.sh index 54d5cf5..8e478c2 100644 --- a/profile/ssh-agent.sh +++ b/profile/ssh-agent.sh @@ -1,3 +1,10 @@ # start the ssh-agent -eval $(ssh-agent -s) +# use keychain(1), if available +if type keychain > /dev/null 2>&1; then + # Save directory name in a variable (for ease of maintenance) + export KEYCHAIN_HOME="$HOME/.keychain" + eval $(keychain --eval --dir "$KEYCHAIN_HOME" --agents ssh) +else + eval $(ssh-agent -s) +fi -- cgit 1.4.1-21-gabe81