change logging
This commit is contained in:
parent
8d2324c4db
commit
c6398a4a87
1 changed files with 6 additions and 5 deletions
|
@ -84,24 +84,25 @@ agent-load-identity-keys () {
|
||||||
|
|
||||||
fingerprints=( $(ssh-runinagent $agentfile "ssh-add -l|awk '{print \$2}'") )
|
fingerprints=( $(ssh-runinagent $agentfile "ssh-add -l|awk '{print \$2}'") )
|
||||||
for key in $(ls ${SSH_IDENTITIES_DIR}/${ssh_identity}|grep -v "pub$\|so$"); do
|
for key in $(ls ${SSH_IDENTITIES_DIR}/${ssh_identity}|grep -v "pub$\|so$"); do
|
||||||
logdebug "key: $key"
|
logtrace "key: $key"
|
||||||
fingerprint=$(ssh-keygen -l -f ~/.ssh/identities/bmi/id_ed25519|awk '{print $2}')
|
fingerprint=$(ssh-keygen -l -f ~/.ssh/identities/bmi/id_ed25519|awk '{print $2}')
|
||||||
logdebug "${fingerprints[*]} and $fingerprint"
|
logtrace "${fingerprints[*]} and $fingerprint"
|
||||||
if [[ ${fingerprints[*]} =~ "$fingerprint" ]]; then
|
if [[ ${fingerprints[*]} =~ "$fingerprint" ]]; then
|
||||||
logdebug "$key is loaded" >&2
|
logdebug "$key is loaded" >&2
|
||||||
else
|
else
|
||||||
logdebug "$key is not loaded" >&2
|
logdebug "$key is not loaded" >&2
|
||||||
ssh-runinagent $agentfile ssh-add ${SSH_ADD_OPTIONS} ${identitydir}/${key}
|
loginfo "$(ssh-runinagent $agentfile ssh-add ${SSH_ADD_OPTIONS} ${identitydir}/${key})"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
for token in $(ls ${SSH_IDENTITIES_DIR}/${ssh_identity}|grep "so$"); do
|
for token in $(ls ${SSH_IDENTITIES_DIR}/${ssh_identity}|grep "so$"); do
|
||||||
logdebug "token: $token"
|
logtrace "token: $token"
|
||||||
tokenfingerprint="$(ssh-keygen -l -D $token|tr -s ' '|awk '{print $2}')"
|
tokenfingerprint="$(ssh-keygen -l -D $token|tr -s ' '|awk '{print $2}')"
|
||||||
|
logtrace "${fingerprints[*]} and $tokenfingerprint"
|
||||||
if [[ ${fingerprints[*]} =~ "$tokenfingerprint" ]]; then
|
if [[ ${fingerprints[*]} =~ "$tokenfingerprint" ]]; then
|
||||||
logdebug "$token is loaded" >&2
|
logdebug "$token is loaded" >&2
|
||||||
else
|
else
|
||||||
logdebug "$token is not loaded" >&2
|
logdebug "$token is not loaded" >&2
|
||||||
ssh-runinagent $agentfile ssh-add ${SSH_ADD_OPTIONS} -s ${identitydir}/${token}
|
loginfo "$(ssh-runinagent $agentfile ssh-add ${SSH_ADD_OPTIONS} -s ${identitydir}/${token})"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue