fix: 5G自动拨号、软件时钟同步、机器人端控制程序自启。

This commit is contained in:
2026-04-11 17:20:52 +08:00
parent 09dd9e24c0
commit 7622360a0e
4 changed files with 63 additions and 13 deletions

View File

@@ -10,6 +10,7 @@ CHRONY_SOURCES_DIR="/etc/chrony/sources.d"
CHRONY_SOURCE_FILE="${CHRONY_SOURCES_DIR}/blitz-robot.sources"
CHRONY_MAIN_CONF="/etc/chrony/chrony.conf"
CHRONY_MAIN_CONF_BAK="/etc/chrony/chrony.conf.blitz-bak"
CHRONY_BURST_SAMPLES="${CHRONY_BURST_SAMPLES:-1/2}"
chrony_unit_name() {
if systemctl list-unit-files chrony.service --no-legend 2>/dev/null | grep -q '^chrony\.service'; then
@@ -96,7 +97,7 @@ write_chrony_source_file
CHRONY_UNIT="$(chrony_unit_name)"
blitz_run "${STEP}" "restart-chrony" systemctl restart "${CHRONY_UNIT}"
blitz_run "${STEP}" "burst" chronyc burst
blitz_run "${STEP}" "burst" chronyc burst "${CHRONY_BURST_SAMPLES}"
blitz_log "${STEP}" "waitsync" "start" "server=${BLITZ_TIME_SERVER_IP} port=${BLITZ_TIME_SERVER_PORT} wait_sec=${BLITZ_TIME_SYNC_WAIT_SEC} max_offset_sec=${BLITZ_TIME_SYNC_MAX_OFFSET_SEC} interval_sec=${BLITZ_TIME_SYNC_INTERVAL_SEC}" 0
if chronyc waitsync "${BLITZ_TIME_SYNC_WAIT_SEC}" "${BLITZ_TIME_SYNC_MAX_OFFSET_SEC}" 1000 "${BLITZ_TIME_SYNC_INTERVAL_SEC}"; then