Don't import ssh keys repeatedly
This commit is contained in:
parent
61618c431f
commit
81842bf038
10
.bashrc
10
.bashrc
@ -39,11 +39,13 @@ if [[ "${OSTYPE}" == "linux-gnu"* ]]; then
|
||||
sed -i '/^echo Agent pid.*/d' $HOME/.ssh/ssh-agent
|
||||
fi
|
||||
eval `\cat $HOME/.ssh/ssh-agent`
|
||||
fi
|
||||
|
||||
for key in $(find "${HOME}/.ssh" -type f -name "*.pub"); do
|
||||
ssh-add -q "${key%.*}"
|
||||
done
|
||||
for key in $(find "${HOME}/.ssh" -type f -name "*.pub"); do
|
||||
# Don't add if a key with this fingerprint is already in the agent.
|
||||
fp="$(ssh-keygen -lf "${key%.*}" | awk '{print $2}')"
|
||||
ssh-add -l |grep -q "${fp}" || ssh-add -q "${key%.*}"
|
||||
done
|
||||
fi
|
||||
|
||||
# bind -x '"\C-r"':reset
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user