test if token is loaded
This commit is contained in:
parent
3c67a1f7ba
commit
cf31d57179
1 changed files with 2 additions and 0 deletions
|
@ -285,6 +285,8 @@ agent-load-identity-keys () {
|
||||||
for key in $(ls ${SSH_IDENTITIES_DIR}/${ssh_identity}/*|grep "\.so$"); do
|
for key in $(ls ${SSH_IDENTITIES_DIR}/${ssh_identity}/*|grep "\.so$"); do
|
||||||
logdebug "P11M: $P11M - key: $key"
|
logdebug "P11M: $P11M - key: $key"
|
||||||
[ "$(readlink - f $key)" == "$P11M" ] || key="$P11M"
|
[ "$(readlink - f $key)" == "$P11M" ] || key="$P11M"
|
||||||
|
logdebug "P11M: $P11M - key: $key"
|
||||||
|
logdebug "$(ssh-add -T $key)"
|
||||||
tokenfingerprint="$(ssh-keygen -l -D $key|tr -s ' '|awk '{print $2}')"
|
tokenfingerprint="$(ssh-keygen -l -D $key|tr -s ' '|awk '{print $2}')"
|
||||||
if [[ ${fingerprints[*]} =~ "$tokenfingerprint" ]]; then
|
if [[ ${fingerprints[*]} =~ "$tokenfingerprint" ]]; then
|
||||||
logdebug "token: $key ($tokenfingerprint) is loaded"
|
logdebug "token: $key ($tokenfingerprint) is loaded"
|
||||||
|
|
Loading…
Reference in a new issue