Created
January 9, 2025 09:27
-
-
Save thomasdarimont/c7f0c0f08db58f199670c70d017b48ae to your computer and use it in GitHub Desktop.
Keycloak Healthcheck for docker without curl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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