healthcheck.sh 415 B

123456789101112131415161718
  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. if [ "$ENABLE_SUBPATH_BASED_ACCESS" = "true" ]; then
  11. curlCheck "http://localhost:80/backend/ping"
  12. else
  13. curlCheck "http://localhost:3000"
  14. curlCheck "http://localhost:3100"
  15. curlCheck "http://localhost:3170/ping"
  16. fi