diff --git a/rootfs/etc/s6-overlay/scripts/airspy_adsb b/rootfs/etc/s6-overlay/scripts/airspy_adsb index 9de3428..f726948 100755 --- a/rootfs/etc/s6-overlay/scripts/airspy_adsb +++ b/rootfs/etc/s6-overlay/scripts/airspy_adsb @@ -142,7 +142,7 @@ if [[ -z "$AIRSPY_ADSB_ARCH" ]]; then else "${s6wrap[@]}" echo "ERROR: Unsupported architecture: $(uname -m)!" - sleep infinity + exec sleep infinity fi fi @@ -152,21 +152,24 @@ AIRSPY_ADSB_BIN="/usr/local/bin/airspy_adsb.${AIRSPY_ADSB_ARCH}" # Ensure binary exists if [[ ! -x "$AIRSPY_ADSB_BIN" ]]; then "${s6wrap[@]}" echo "ERROR: Executable binary not found for architecture: $AIRSPY_ADSB_ARCH!" - sleep infinity + exec sleep infinity fi # Ensure binary runnable if ! "$AIRSPY_ADSB_BIN" -h > /dev/null 2>&1; then "${s6wrap[@]}" echo "ERROR: Executable $AIRSPY_ADSB_ARCH binary not supported on $(uname -m) architecture!" - sleep infinity + exec sleep infinity fi # Execute binary with arguments prepared above "${s6wrap[@]}" echo "Running $AIRSPY_ADSB_ARCH binary on $(uname -m) architecture." "${s6wrap[@]}" echo "Running: ${AIRSPY_ADSB_BIN} ${AIRSPY_ADSB_CMD[*]}" +# Slow down restarts +sleep 10 & + #shellcheck disable=SC2016 -"${s6wrap[@]}" "${AIRSPY_ADSB_BIN}" "${AIRSPY_ADSB_CMD[@]}" +"${s6wrap[@]}" "${AIRSPY_ADSB_BIN}" "${AIRSPY_ADSB_CMD[@]}" & -# Slow down restarts -sleep 10 +# trap will only work properly while the shell is running / waiting, not while another program is being foreground executed +wait || true