healthcheck.sh 301 B

1234567891011121314
  1. #!/bin/bash
  2. curlCheck() {
  3. if ! curl -s --head "$1" | head -n 1 | grep -q "HTTP/1.[01] [23].."; then
  4. echo "URL request failed!"
  5. exit 1
  6. else
  7. echo "URL request succeeded!"
  8. fi
  9. }
  10. curlCheck "http://localhost:3000"
  11. curlCheck "http://localhost:3100"
  12. curlCheck "http://localhost:3170/ping"