update 2026-09-15 17:08:00

This commit is contained in:
action committed 2026-09-15 17:08:00 +08:00
1 parent bb8ab7ae16
commit b109228443
13 files changed
+128 -132

No files matched your search

@@ -1,17 +1,12 @@
#!/bin/sh
# Devices without a hardware RTC boot with a wrong system clock: sysfixtime can
# only restore the mtime of the newest file under /etc, so the clock is usually
# hours behind after a cold boot. passwall2 is then started by
# /etc/hotplug.d/iface/98-passwall2 on ifup, which typically happens before NTP
# has corrected the time, and time-sensitive handshakes (VMess AEAD, TLS) fail.
#
# Nothing restarts passwall2 once the clock is corrected, so it stays broken
# until the user restarts it manually. Restart once when ntpd reports that the
# time is valid -- the same approach dnsmasq uses for DNSSEC in
# /etc/hotplug.d/ntp/25-dnsmasqsec.
[ "$ACTION" = "step" ] || exit 0
[ "$ACTION" = "stratum" ] || exit 0
offset=${offset#-}
offset=${offset%.*}
# Skip service restart if the time adjustment is less than 120 seconds.
[ "$offset" -lt 120 ] && exit 0
. /usr/share/passwall2/utils.sh
@@ -23,5 +18,5 @@ NTP_LOCK_FILE="${LOCK_PATH}/${CONFIG}_ntp.lock"
echo $$ > ${NTP_LOCK_FILE}
/etc/init.d/${CONFIG} restart >/dev/null 2>&1 &
logger -p notice -t network -s "${CONFIG}: restart after NTP time became valid"
logger -p notice -t network -s "${CONFIG}: restart after NTP time step (${offset}s)"
}