diff --git a/rootfs/etc/s6-overlay/scripts/dump978 b/rootfs/etc/s6-overlay/scripts/dump978 index ea6442c..5ae904a 100755 --- a/rootfs/etc/s6-overlay/scripts/dump978 +++ b/rootfs/etc/s6-overlay/scripts/dump978 @@ -52,7 +52,8 @@ if [[ -n "$READSB_SDR_GAIN" ]]; then sleep 3 # let autogain do its inital thing if [[ "${READSB_SDR_GAIN,,}" == "autogain" ]] && [[ -f /var/globe_history/autogain/gain ]]; then read -r gain < /var/globe_history/autogain/gain - DUMP978_CMD+=("--sdr-gain $gain") + gain="${gain:-${DUMP978_AUTOGAIN_INITIAL_GAIN:-${READSB_AUTOGAIN_INITIAL_GAIN:-49.6}}}" + DUMP978_CMD+=("--sdr-gain $gain") elif [[ -n "$READSB_SDR_GAIN" ]]; then [[ "${READSB_SDR_GAIN,,}" == "autogain" ]] && gain="${DUMP978_AUTOGAIN_INITIAL_GAIN:-${READSB_AUTOGAIN_INITIAL_GAIN:-49.6}}" || gain="${READSB_SDR_GAIN}" DUMP978_CMD+=("--sdr-gain $gain")