Created
January 24, 2018 19:11
-
-
Save joshlove/ff5f52d978849066497a124a1f63657c to your computer and use it in GitHub Desktop.
Checks qualy's rating
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 +x | |
#clone the repo if it's not there. | |
if [ ! -d ssllabs-scan ]; then | |
ssh-keyscan -H github.com >> ~/.ssh/known_hosts | |
git clone git://github.com/ssllabs/ssllabs-scan.git | |
fi | |
#jump into it | |
cd ssllabs-scan | |
#check if we have a built binary | |
if [ ! -f ssllabs-scan ]; then | |
go build ssllabs-scan.go | |
fi | |
function scan(){ | |
result=$(./ssllabs-scan --quiet --grade $1) | |
if ! [[ "${result}" =~ "A" ]]; then | |
echo "$1 did not receive an A rating" | |
return 1 | |
else | |
return 0 | |
fi | |
} | |
status=0 | |
for i in domain1.com domain2.com | |
do | |
scan $i || status=1 | |
done | |
if [ $status == 1 ]; then | |
exit 1 | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment