Skip to content

Instantly share code, notes, and snippets.

@sathed
Last active October 29, 2019 20:19
Show Gist options
  • Save sathed/9181b58da963207a374f2fd370f0a703 to your computer and use it in GitHub Desktop.
Save sathed/9181b58da963207a374f2fd370f0a703 to your computer and use it in GitHub Desktop.
Use curl to retrieve only the status code.
#!/bin/bash
# For CA certs.
curl -so /dev/null -w "%{http_code}" https://google.com/
# For self-signed certs:
curl --insecure -so /dev/null -w "%{http_code}" https://somesite.com/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment