Skip to content

Instantly share code, notes, and snippets.

@thomasdarimont
Created January 9, 2025 09:27
Show Gist options
  • Save thomasdarimont/c7f0c0f08db58f199670c70d017b48ae to your computer and use it in GitHub Desktop.
Save thomasdarimont/c7f0c0f08db58f199670c70d017b48ae to your computer and use it in GitHub Desktop.
Keycloak Healthcheck for docker without curl
#!/bin/bash
exec 3<>/dev/tcp/localhost/8080
echo -e "GET /auth/health/ready HTTP/1.1\nhost: localhost:8080\n" >&3
timeout --preserve-status 1 cat <&3 | grep -m 1 status | grep -m 1 UP
ERROR=$?
exec 3<&-
exec 3>&-
exit $ERROR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment