Skip to content

Instantly share code, notes, and snippets.

@stephenyeargin
Created June 21, 2020 17:50
Show Gist options
  • Save stephenyeargin/1b26122cf1d5eef91ef7270bd66da487 to your computer and use it in GitHub Desktop.
Save stephenyeargin/1b26122cf1d5eef91ef7270bd66da487 to your computer and use it in GitHub Desktop.
Checks given domains (as arguments) for certificate expiration.
#!/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