Use test_connection function for keepalive check
Replaces inline ping with existing test_connection function
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user