Skip to content

Commit

Permalink
make sure that READSB_AUTOGAIN_INITIAL_GAIN is also used at first s…
Browse files Browse the repository at this point in the history
…tartup of readsb
  • Loading branch information
kx1t committed Oct 25, 2023
1 parent 1b0ec5c commit 58744dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rootfs/etc/s6-overlay/scripts/readsb
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ if [[ -n "$READSB_GAIN" ]]; then
read -r gain < /var/globe_history/autogain/gain
READSB_CMD+=("--gain=$gain")
elif [[ -n "$READSB_GAIN" ]]; then
[[ "${READSB_GAIN,,}" == "autogain" ]] && gain="49.6" || gain="${READSB_GAIN}"
[[ "${READSB_GAIN,,}" == "autogain" ]] && gain="${READSB_AUTOGAIN_INITIAL_GAIN:-49.6}" || gain="${READSB_GAIN}"
READSB_CMD+=("--gain=$gain")
fi
fi
Expand Down

1 comment on commit 58744dd

@dirkhh
Copy link
Contributor

@dirkhh dirkhh commented on 58744dd Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a quick reminder that if condition then then-clause else else-clause and condition && then-clause || else-clause are not semantically equivalent... This ONLY works if the then-clause always returns true. So I think here it does the right thing... but it's something I tripped over more than once.

Please sign in to comment.