mirror of
https://github.com/cjfranko/NTP-Timeturner.git
synced 2025-11-08 18:32:02 +00:00
feat: add development mode flag HACI_DEV and PTP status fields in API/UI
Co-authored-by: aider (openai/gpt-5) <aider@aider.chat>
This commit is contained in:
parent
ee4a5a3630
commit
d8eb1f9824
6 changed files with 115 additions and 1 deletions
|
|
@ -1,5 +1,7 @@
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
# Mark container as development unless explicitly disabled
|
||||
export HACI_DEV="${HACI_DEV:-1}"
|
||||
|
||||
# If enabled, start a mock Teensy that exposes a PTY at /dev/ttyACM0 and streams LTC-like lines.
|
||||
if [ "${MOCK_TEENSY:-0}" = "1" ]; then
|
||||
|
|
@ -26,5 +28,19 @@ if [ "${MOCK_TEENSY:-0}" = "1" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Optionally start the PTP daemon (statime) for development
|
||||
if [ "${RUN_STATIME:-0}" = "1" ]; then
|
||||
echo "[entrypoint] Starting statime PTP daemon..." >&2
|
||||
if command -v statime >/dev/null 2>&1; then
|
||||
IFACE="${PTP_INTERFACE:-eth0}"
|
||||
echo "[entrypoint] statime interface: ${IFACE}" >&2
|
||||
# Run statime in background; logs to container stderr/stdout
|
||||
statime -i "${IFACE}" &
|
||||
STATIME_PID=$!
|
||||
else
|
||||
echo "[entrypoint] statime not found on PATH" >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
# Run the requested command (default: get-haci)
|
||||
exec "$@"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue