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
|
# Keepalive ping every 5 minutes
|
||||||
if [ $((now - last_keepalive)) -ge $keepalive_interval ]; then
|
if [ $((now - last_keepalive)) -ge $keepalive_interval ]; then
|
||||||
if [[ -n "$IBMI_HOST" ]] && ping -c 1 -W 5 "$IBMI_HOST" &>/dev/null; then
|
test_connection || log WARN "VPN may be degraded"
|
||||||
log DEBUG "Keepalive ping to $IBMI_HOST successful"
|
|
||||||
else
|
|
||||||
log WARN "Keepalive ping to $IBMI_HOST failed (VPN may be degraded)"
|
|
||||||
fi
|
|
||||||
last_keepalive=$now
|
last_keepalive=$now
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user