Stabilize U
This commit is contained in:
@@ -8,10 +8,19 @@ USER_AGENT="stellaops-healthcheck"
|
||||
|
||||
fetch() {
|
||||
target_path="$1"
|
||||
# BusyBox wget is available in Alpine; curl not assumed.
|
||||
wget -qO- "http://${HOST}:${PORT}${target_path}" \
|
||||
--header="User-Agent: ${USER_AGENT}" \
|
||||
--timeout="${HEALTH_TIMEOUT:-4}" >/dev/null
|
||||
url="http://${HOST}:${PORT}${target_path}"
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
curl -sf --max-time "${HEALTH_TIMEOUT:-4}" \
|
||||
-H "User-Agent: ${USER_AGENT}" \
|
||||
"$url" >/dev/null
|
||||
elif command -v wget >/dev/null 2>&1; then
|
||||
wget -qO- "$url" \
|
||||
--header="User-Agent: ${USER_AGENT}" \
|
||||
--timeout="${HEALTH_TIMEOUT:-4}" >/dev/null
|
||||
else
|
||||
# Fallback: bash /dev/tcp (liveness only, no HTTP headers)
|
||||
exec 3<>"/dev/tcp/${HOST}/${PORT}" && exec 3>&-
|
||||
fi
|
||||
}
|
||||
|
||||
fail=0
|
||||
|
||||
Reference in New Issue
Block a user