Switch the lab reflector to jayReflector and harden local station use.

Build DJ1JAY’s fork with an optional Satellite/Trunk stub, allow -c/--config, open capture and playback as separate devices, and add a lab start helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-07 12:14:41 +02:00
co-authored by Cursor
parent f90b6150f3
commit f8cad55e9c
24 changed files with 847 additions and 225 deletions
+27 -45
View File
@@ -1,17 +1,11 @@
#!/bin/sh
set -eu
SVXLINK_CONF="${SVXLINK_CONF:-/etc/svxlink/svxlink.conf}"
REMOTETRX_CONF="${REMOTETRX_CONF:-/etc/svxlink/remotetrx.conf}"
SVXREFLECTOR_CONF="${SVXREFLECTOR_CONF:-/etc/svxlink/svxreflector.conf}"
START_SVXLINK="${START_SVXLINK:-0}"
START_REMOTETRX="${START_REMOTETRX:-0}"
START_SVXREFLECTOR="${START_SVXREFLECTOR:-1}"
SVXLINK_ARGS="${SVXLINK_ARGS:-}"
REMOTETRX_ARGS="${REMOTETRX_ARGS:-}"
SVXREFLECTOR_LINK_CONF="${SVXREFLECTOR_LINK_CONF:-/etc/svxlink/svxreflector.link.conf}"
SVXREFLECTOR_ARGS="${SVXREFLECTOR_ARGS:-}"
ENABLE_FM_LINK="${ENABLE_FM_LINK:-0}"
RUNTIME_CONF="/tmp/svxreflector.runtime.conf"
pids=""
@@ -24,15 +18,6 @@ die() {
exit 1
}
need_file_if_enabled() {
enabled="$1"
file="$2"
name="$3"
if [ "$enabled" = "1" ] && [ ! -f "$file" ]; then
die "Config for $name not found: $file (expected volume mount)"
fi
}
start_bg() {
name="$1"
shift
@@ -70,37 +55,34 @@ stop_all() {
trap 'stop_all; exit 0' INT TERM
if [ "$START_SVXLINK" = "1" ] && ! command -v svxlink >/dev/null 2>&1; then
die "svxlink binary not found"
fi
if [ "$START_REMOTETRX" = "1" ] && ! command -v remotetrx >/dev/null 2>&1; then
die "remotetrx binary not found"
fi
if [ "$START_SVXREFLECTOR" = "1" ] && ! command -v svxreflector >/dev/null 2>&1; then
die "svxreflector binary not found"
command -v svxreflector >/dev/null 2>&1 || die "svxreflector binary not found (jayReflector build)"
[ -f "$SVXREFLECTOR_CONF" ] || die "Config not found: $SVXREFLECTOR_CONF (expected volume mount)"
# Local-only by default. When ENABLE_FM_LINK=1, append the link stub
# (Satellite or Trunk keys from DJ1JAY) after the base lab conf.
if [ "$ENABLE_FM_LINK" = "1" ]; then
[ -f "$SVXREFLECTOR_LINK_CONF" ] || die "ENABLE_FM_LINK=1 but link config missing: $SVXREFLECTOR_LINK_CONF"
{
cat "$SVXREFLECTOR_CONF"
echo
echo "###################################################################"
echo "# Appended FM-Funknetz link stub (ENABLE_FM_LINK=1)"
echo "###################################################################"
cat "$SVXREFLECTOR_LINK_CONF"
} >"$RUNTIME_CONF"
conf_path="$RUNTIME_CONF"
log "FM link enabled: using $SVXREFLECTOR_CONF + $SVXREFLECTOR_LINK_CONF"
else
conf_path="$SVXREFLECTOR_CONF"
log "FM link disabled (ENABLE_FM_LINK=0): local lab reflector only"
fi
need_file_if_enabled "$START_SVXLINK" "$SVXLINK_CONF" "svxlink"
need_file_if_enabled "$START_REMOTETRX" "$REMOTETRX_CONF" "remotetrx"
need_file_if_enabled "$START_SVXREFLECTOR" "$SVXREFLECTOR_CONF" "svxreflector"
# Ensure PKI dir exists for first-start cert bootstrap.
mkdir -p /etc/svxlink/pki /var/lib/svxlink/pki
if [ "$START_SVXREFLECTOR" = "1" ]; then
start_bg "svxreflector" svxreflector --config "$SVXREFLECTOR_CONF" $SVXREFLECTOR_ARGS
fi
start_bg "svxreflector" svxreflector --config "$conf_path" $SVXREFLECTOR_ARGS
if [ "$START_REMOTETRX" = "1" ]; then
start_bg "remotetrx" remotetrx --config "$REMOTETRX_CONF" $REMOTETRX_ARGS
fi
if [ "$START_SVXLINK" = "1" ]; then
start_bg "svxlink" svxlink --config "$SVXLINK_CONF" $SVXLINK_ARGS
fi
if ! echo "$pids" | grep -q '[0-9]'; then
die "No service enabled. Set START_SVXREFLECTOR=1 (lab default) and/or START_SVXLINK / START_REMOTETRX"
fi
log "Requested services are running. Waiting…"
log "jayReflector (svxreflector) is running. Waiting…"
exit_code=0
for pid in $pids; do