Created
June 21, 2020 17:50
-
-
Save stephenyeargin/1b26122cf1d5eef91ef7270bd66da487 to your computer and use it in GitHub Desktop.
Checks given domains (as arguments) for certificate expiration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
domains=("$@") | |
for i in ${!domains[@]}; do | |
echo ${domains[$i]} | |
echo "" | openssl s_client -connect ${domains[$i]}:443 -servername ${domains[$i]} 2>/dev/null | openssl x509 -noout -enddate | sed -e 's/^notAfter\=//' | |
echo "" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment