mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-05 17:51:25 -07:00
Fix healthcheck for non-0.0.0.0. will pass as long as reachable.
This commit is contained in:
@@ -49,10 +49,11 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# 5. Check port 20211 is open and contains "netalertx"
|
# 5. Check port 20211 is open and contains "netalertx"
|
||||||
if curl -sf --max-time 10 "http://localhost:${PORT:-20211}" | grep -i "netalertx" > /dev/null; then
|
[ "${LISTEN_ADDR}" == "0.0.0.0" ] && CHECK_ADDR="127.0.0.1" || CHECK_ADDR="${LISTEN_ADDR}";
|
||||||
log_success "Port ${PORT:-20211} is responding and contains 'netalertx'"
|
if timeout 10 bash -c "</dev/tcp/${CHECK_ADDR}/${PORT:-20211}" 2>/dev/null; then
|
||||||
|
log_success "Port ${PORT:-20211} is responding"
|
||||||
else
|
else
|
||||||
log_error "Port ${PORT:-20211} is not responding or doesn't contain 'netalertx'"
|
log_error "Port ${PORT:-20211} is not responding"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# NOTE: GRAPHQL_PORT might not be set and is initailized as a setting with a default value in the container. It can also be initialized via APP_CONF_OVERRIDE
|
# NOTE: GRAPHQL_PORT might not be set and is initailized as a setting with a default value in the container. It can also be initialized via APP_CONF_OVERRIDE
|
||||||
@@ -71,4 +72,4 @@ else
|
|||||||
echo "[HEALTHCHECK] ❌ One or more health checks failed"
|
echo "[HEALTHCHECK] ❌ One or more health checks failed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit $EXIT_CODE
|
exit $EXIT_CODE
|
||||||
|
|||||||
Reference in New Issue
Block a user