only attempt healthchecks URL if non-empty

This commit is contained in:
Christer Edwards
2025-07-18 20:33:27 -06:00
parent 91dd8b2c03
commit 64fc818fa7

View File

@@ -191,9 +191,11 @@ done
# Final ping to healthcheck URL
if [ "$SERVICE_FAILED" -eq 0 ]; then
curl -fsS --retry 3 "${bastille_monitor_healthchecks}" > /dev/null 2>&1
else
curl -fsS --retry 3 "${bastille_monitor_healthchecks}/fail" > /dev/null 2>&1
if [ -n "${bastille_monitor_healthchecks}" ]; then
curl -fsS --retry 3 "${bastille_monitor_healthchecks}" > /dev/null 2>&1
else
curl -fsS --retry 3 "${bastille_monitor_healthchecks}/fail" > /dev/null 2>&1
fi
fi
wait