From 29ee6c0bd54c915113c24294ad1f540941e515bd Mon Sep 17 00:00:00 2001 From: iceBear67 Date: Mon, 6 Jul 2026 13:50:08 +0800 Subject: [PATCH] use ping for connectivity checkers --- image/overlay/etc/init.d/auth-server | 16 ++++++++++++++++ image/overlay/etc/init.d/tsdns | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/image/overlay/etc/init.d/auth-server b/image/overlay/etc/init.d/auth-server index d80abfb..c33da84 100755 --- a/image/overlay/etc/init.d/auth-server +++ b/image/overlay/etc/init.d/auth-server @@ -6,6 +6,22 @@ output_log="/data/auth-server.log" pidfile="/run/${RC_SVCNAME}.pid" +start_pre() { + ebegin "Waiting for network" + + timeout=30 + + while [ $timeout -gt 0 ]; do + ip route | grep -q default && break + sleep 1 + timeout=$((timeout-1)) + done + + ip route | grep -q default || return 1 + + eend 0 +} + depend() { need net } diff --git a/image/overlay/etc/init.d/tsdns b/image/overlay/etc/init.d/tsdns index 5831fc1..268670a 100755 --- a/image/overlay/etc/init.d/tsdns +++ b/image/overlay/etc/init.d/tsdns @@ -4,6 +4,22 @@ depend() { need docker net } +start_pre() { + ebegin "Waiting for network" + + timeout=30 + + while [ $timeout -gt 0 ]; do + ip route | grep -q default && break + sleep 1 + timeout=$((timeout-1)) + done + + ip route | grep -q default || return 1 + + eend 0 +} + command="/usr/bin/tsdns" command_background=true pidfile="/run/${RC_SVCNAME}.pid"