add certificate validity check in startagent
This commit is contained in:
parent
52626b5a09
commit
b85250cd11
1 changed files with 3 additions and 0 deletions
|
@ -277,6 +277,9 @@ agent-load-identity-keys () {
|
|||
echo "pubkey without privkey: $pubkey"
|
||||
pubkeysonly+=($pubkey)
|
||||
fi
|
||||
[ -e "${pubkey%.pub}-cert.pub" ] && \
|
||||
[ $(date +%s -d $(ssh-keygen -L -f "${pubkey%.pub}-cert.pub"|awk '$1 == "Valid:"{print $5}')) -le $(date +%s -d NOW) ] \
|
||||
|| logwarn "CERTIFICATE IS NOT VALID ANYMORE: ${pubkey%.pub}-cert.pub"
|
||||
done
|
||||
loginfo "pubkeysonly: ${pubkeysonly[@]} (count: ${#pubkeysonly[*]})"
|
||||
|
||||
|
|
Loading…
Reference in a new issue