Created
September 20, 2017 04:01
-
-
Save pior/b5d41460f6857d71bd485d1e418dacd7 to your computer and use it in GitHub Desktop.
Fetch some information from a host or an url
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
| httpinfo () { | |
| local urlorhost=$1 | |
| local host=${urlorhost#*//} | |
| local bold=$(tput setaf 37); | |
| local reset=$(tput sgr0); | |
| echo "${bold}DNS records:${reset}" | |
| dig +nocmd ${host} any +multiline +noall +answer; | |
| echo "" | |
| echo "${bold}TLS certificates:${reset}" | |
| curl --insecure -v https://${host} 2>&1 | awk 'BEGIN { cert=0 } /^\* Server certificate:/ { cert=1 } /^\*/ { if (cert) print }' | |
| echo "" | |
| echo "${bold}HTTP HEAD method (with TLS):${reset}" | |
| curl -I https://${host} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment