use ping for connectivity checkers

This commit is contained in:
iceBear67
2026-07-06 13:50:08 +08:00
parent 14bd29fb94
commit 29ee6c0bd5
2 changed files with 32 additions and 0 deletions

View File

@@ -6,6 +6,22 @@ output_log="/data/auth-server.log"
pidfile="/run/${RC_SVCNAME}.pid" 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() { depend() {
need net need net
} }

View File

@@ -4,6 +4,22 @@ depend() {
need docker net 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="/usr/bin/tsdns"
command_background=true command_background=true
pidfile="/run/${RC_SVCNAME}.pid" pidfile="/run/${RC_SVCNAME}.pid"