mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-15 01:48:34 -07:00
fix(ssh-agent): add identity only if identity exists (#12371)
This commit is contained in:
parent
0c80a063c3
commit
67581c53c6
@ -62,7 +62,7 @@ function _add_identities() {
|
|||||||
# if id is an absolute path, make file equal to id
|
# if id is an absolute path, make file equal to id
|
||||||
[[ "$id" = /* ]] && file="$id" || file="$HOME/.ssh/$id"
|
[[ "$id" = /* ]] && file="$id" || file="$HOME/.ssh/$id"
|
||||||
# check for filename match, otherwise try for signature match
|
# check for filename match, otherwise try for signature match
|
||||||
if [[ ${loaded_ids[(I)$file]} -le 0 ]]; then
|
if [[ -f $file && ${loaded_ids[(I)$file]} -le 0 ]]; then
|
||||||
sig="$(ssh-keygen -lf "$file" | awk '{print $2}')"
|
sig="$(ssh-keygen -lf "$file" | awk '{print $2}')"
|
||||||
[[ ${loaded_sigs[(I)$sig]} -le 0 ]] && not_loaded+=("$file")
|
[[ ${loaded_sigs[(I)$sig]} -le 0 ]] && not_loaded+=("$file")
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user