cert-expirations.sh
script to print out certificates expiration dates
This commit is contained in:
parent
a6c153b546
commit
c335b30623
16
cert-expirations.sh
Normal file
16
cert-expirations.sh
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "CA certificate:"
|
||||||
|
openssl x509 -enddate -noout -in /etc/shellpki/cacert.pem \
|
||||||
|
| cut -d '=' -f 2 \
|
||||||
|
| sed -e "s/^\(.*\)\ \(20..\).*/- \2 \1/"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
echo "Client certificates:"
|
||||||
|
grep "Not After" -r /etc/shellpki/certs/ \
|
||||||
|
| sed -e "s/^.*certs\/\([-.a-z0-9]*\).*After\ :\ \(.*\).*GMT$/\2\1X/" \
|
||||||
|
| sed -e "s/^\(.*\)\ \(20..\)\ \(.*\)$/- \2 \1 \3/" \
|
||||||
|
| tr "X" "\n" \
|
||||||
|
| sed '/^$/d' \
|
||||||
|
| sort -n -k 2 -k 3M -k 4
|
Loading…
Reference in a new issue