Skip to content

Instantly share code, notes, and snippets.

@zafergurel
Created March 2, 2021 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zafergurel/63290ac725f655b3d0b9e613e83d3569 to your computer and use it in GitHub Desktop.
Save zafergurel/63290ac725f655b3d0b9e613e83d3569 to your computer and use it in GitHub Desktop.
check-ssl-cert.sh
domain=$1
ips="$(nslookup $1 | grep -zoP "Non-authoritative(.|\n)+" | grep -aPo "\d+\.\d+\.\d+\.\d+")";
# echo $ips;
for ip in $ips; do
echo "Checking $domain on $ip";
curl --resolve $domain:443:$ip https://$domain -s -S > /dev/null
curl --verbose --resolve $domain:443:$ip https://$domain 2>&1 | grep -E "expire"
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment