Created
April 16, 2019 22:32
-
-
Save adborden/f0dc1cfa0eb8912ec4def8322860377c to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
set -o errexit | |
set -o pipefail | |
set -o nounset | |
function check () { | |
local domain="$1" | |
certificate_info=$(mktemp) | |
# openssl doesn't exit 0 in some cases | |
openssl s_client -connect "${domain}:443" -servername "${domain}" < /dev/null > "$certificate_info" 2>&1 || true | |
if grep -q DigiCert "$certificate_info"; then | |
echo ok | |
else | |
echo fail | |
fi | |
rm -rf "$certificate_info" | |
} | |
while read domain; do | |
echo "$domain"... $(check "$domain") | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment