Skip to content

Commit

Permalink
readsb: avoid restarts which are too fast (#124)
Browse files Browse the repository at this point in the history
start instantly on first start though
  • Loading branch information
fredclausen authored Aug 5, 2024
2 parents 4624494 + e0ac71f commit 95761dc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rootfs/etc/s6-overlay/scripts/readsb
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,12 @@ if chk_enabled "$PROMETHEUS_ENABLE"; then
READSB_CMD+=("--write-prom=/run/readsb-prometheus.prom")
fi

# wait 15 seconds if this is not the first startup
if [[ $(s6-svdt /run/service/readsb | wc -l) != 0 ]]; then
"${s6wrap[@]}" --args echo "delaying restart by 15 seconds"
sleep 15
fi

# shellcheck disable=SC2086
if [[ "${LOGLEVEL,,}" == "verbose" ]]; then
exec "${s6wrap[@]}" --args "${READSB_BIN}" "${READSB_CMD[@]}" $READSB_AUTOMATION_ARGS $READSB_EXTRA_ARGS
Expand Down

0 comments on commit 95761dc

Please sign in to comment.