if curl -s --head --request GET http://192.168.27.248 | grep "200 OK" > /dev/null; then echo "HTTP connection to example.com is available" else echo "HTTP connection to example.com failed" fi if curl -s -k --head --fail https://192.168.27.248 > /dev/null; then echo "HTTPS connection to example.com is available (ignoring cert issues)" else echo "HTTPS connection to example.com failed" fi