test status http curl code example
Example 1: get status code of curl
curl -o /dev/null -s -w "%{http_code}\n" http://localhost
Example 2: curl test https
curl --insecure -v https://www.google.com 2>&1 | awk 'BEGIN { cert=0 } /^\* Server certificate:/ { cert=1 } /^\*/ { if (cert) print }'