add script to determine ssl certificates expiry
This commit is contained in:
parent
30d387b5f2
commit
b498e0ba31
15
.bin/cert_expiry
Executable file
15
.bin/cert_expiry
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
# Prints the expiration dates of all TLS Certificates in a directory
|
||||
|
||||
# This is usually pem, but can also be crt
|
||||
if [[ -z $1 ]]; then
|
||||
echo "certificate type not set, defaulting to pem"
|
||||
filetype="pem"
|
||||
else
|
||||
filetype=$1
|
||||
fi
|
||||
|
||||
for filename in ./*.${filetype}; do
|
||||
echo -n "${filename} expires on: "
|
||||
openssl x509 -noout -dates -in "${filename}" | sed -n '/notAfter/p' | sed 's/^.\{9\}//'
|
||||
done
|
Loading…
Reference in New Issue
Block a user