Created
December 27, 2018 03:32
-
-
Save jokester/f1bd8f4e549a786b5feda105dba04272 to your computer and use it in GitHub Desktop.
print server certificate (for expiration check and stuff)
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 | |
set -ue | |
if [[ $# -eq 0 ]]; then | |
echo "USAGE: $0 HOST+" | |
echo " prints expiration date of https certs with curl" | |
exit 1 | |
fi | |
for i in "$@"; do | |
echo "----------------- https://$i START" | |
curl -v --silent -I "https://$i/.well_known/whatever.txt" 2>&1 | sed -n '/^* Server certificate/,/> Host/p' | |
echo "----------------- https://$i END" | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment