diff --git a/bin/ssh-agent-start-or-restart b/bin/ssh-agent-start-or-restart index a960469..421c333 100755 --- a/bin/ssh-agent-start-or-restart +++ b/bin/ssh-agent-start-or-restart @@ -73,9 +73,10 @@ agent-load-identity-keys () { if [ -n "${1+x}" ]; then ssh_identity="$1" + identitydir=${SSH_IDENTITIES_DIR}/${ssh_identity} + [ -e "${identitydir}/.config" ] && . "${identitydir}/.config" agentfile="${SSH_AGENTS_DIR}/agent-${ssh_identity}-$(hostname)" agentsocket="${SSH_AGENT_SOCKETS_DIR}/socket-${ssh_identity}-$(hostname)" - identitydir=${SSH_IDENTITIES_DIR}/${ssh_identity} echo "agentfile: $agentfile" >&2 echo "agentsocket: $agentsocket" >&2 echo ssh-identität: $ssh_identity >&2 diff --git a/functions.sh b/functions.sh index a350b6c..50d18a4 100755 --- a/functions.sh +++ b/functions.sh @@ -688,12 +688,14 @@ token () { case $1 in -f) FORCE=true - ssh_identity=$2 + ssh_identity=${2-default} ;; *) - ssh_identity=$1 + ssh_identity=${1-default} ;; esac + identitydir=${SSH_IDENTITIES_DIR}/${ssh_identity} + [ -e "${identitydir}/.config" ] && . "${identitydir}/.config" local fingerprints declare -a fingerprints local tokenfingerprint