Use test_connection function for keepalive check

Replaces inline ping with existing test_connection function
This commit is contained in:
2026-01-17 17:57:46 +00:00
parent 5f057c50ed
commit bf60412640

View File

@@ -521,11 +521,7 @@ start_watchdog() {
# Keepalive ping every 5 minutes
if [ $((now - last_keepalive)) -ge $keepalive_interval ]; then
if [[ -n "$IBMI_HOST" ]] && ping -c 1 -W 5 "$IBMI_HOST" &>/dev/null; then
log DEBUG "Keepalive ping to $IBMI_HOST successful"
else
log WARN "Keepalive ping to $IBMI_HOST failed (VPN may be degraded)"
fi
test_connection || log WARN "VPN may be degraded"
last_keepalive=$now
fi
else