fix logic for timestamp
This commit is contained in:
parent
b85250cd11
commit
125976716b
1 changed files with 5 additions and 2 deletions
|
@ -277,9 +277,12 @@ agent-load-identity-keys () {
|
||||||
echo "pubkey without privkey: $pubkey"
|
echo "pubkey without privkey: $pubkey"
|
||||||
pubkeysonly+=($pubkey)
|
pubkeysonly+=($pubkey)
|
||||||
fi
|
fi
|
||||||
[ -e "${pubkey%.pub}-cert.pub" ] && \
|
if [ -e "${pubkey%.pub}-cert.pub" ]; then
|
||||||
[ $(date +%s -d $(ssh-keygen -L -f "${pubkey%.pub}-cert.pub"|awk '$1 == "Valid:"{print $5}')) -le $(date +%s -d NOW) ] \
|
#logwarn "${pubkey%.pub}-cert.pub: $(date +%s -d $(ssh-keygen -L -f "${pubkey%.pub}-cert.pub"|awk '$1 == "Valid:"{print $5}'))"
|
||||||
|
#logwarn "now: $(date +%s -d NOW)"
|
||||||
|
[ $(date +%s -d $(ssh-keygen -L -f "${pubkey%.pub}-cert.pub"|awk '$1 == "Valid:"{print $5}')) -gt $(date +%s -d NOW) ] \
|
||||||
|| logwarn "CERTIFICATE IS NOT VALID ANYMORE: ${pubkey%.pub}-cert.pub"
|
|| logwarn "CERTIFICATE IS NOT VALID ANYMORE: ${pubkey%.pub}-cert.pub"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
loginfo "pubkeysonly: ${pubkeysonly[@]} (count: ${#pubkeysonly[*]})"
|
loginfo "pubkeysonly: ${pubkeysonly[@]} (count: ${#pubkeysonly[*]})"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue