-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from IQTLabs/geometric-altitude
Geometric altitude
- Loading branch information
Showing
4 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM mikenye/piaware:latest | ||
|
||
ADD run /etc/services.d/dump1090/ | ||
|
||
EXPOSE 80/tcp 30003/tcp 30005/tcp 30105/tcp 30978/tcp 30979/tcp | ||
|
||
ENTRYPOINT [ "/init" ] | ||
|
||
HEALTHCHECK --start-period=7200s --interval=600s CMD /scripts/healthcheck.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/with-contenv bash | ||
# shellcheck shell=bash | ||
set -eo pipefail | ||
|
||
mkdir -p /run/dump1090-fa | ||
|
||
DUMP1090_BIN="/usr/local/bin/dump1090" | ||
|
||
# Global settings | ||
DUMP1090_CMD=("--quiet") | ||
DUMP1090_CMD+=("--lat" "$LAT") | ||
DUMP1090_CMD+=("--lon" "$LONG") | ||
DUMP1090_CMD+=("--net") | ||
DUMP1090_CMD+=("--fix") | ||
DUMP1090_CMD+=("--gnss") | ||
DUMP1090_CMD+=("--json-location-accuracy" "2") | ||
DUMP1090_CMD+=("--write-json" "/run/dump1090-fa") | ||
DUMP1090_CMD+=("--net-bind-address" "0.0.0.0") | ||
|
||
# Handle "--modeac" | ||
if [[ "$ALLOW_MODEAC" == "yes" ]]; then | ||
DUMP1090_CMD+=("--modeac") | ||
fi | ||
|
||
# If a BEASTHOST is specified | ||
if [[ -n "$BEASTHOST" ]]; then | ||
DUMP1090_CMD+=("--net-only") | ||
|
||
# Default - rtlsdr mode | ||
else | ||
DUMP1090_CMD+=("--device-type" "rtlsdr") | ||
|
||
if [[ -n "$DUMP1090_DEVICE" ]]; then | ||
DUMP1090_CMD+=("--device" "$DUMP1090_DEVICE") | ||
fi | ||
|
||
if [[ -n "$RTLSDR_PPM" ]]; then | ||
DUMP1090_CMD+=("--ppm" "$RTLSDR_PPM") | ||
fi | ||
|
||
if [[ -n "$RTLSDR_GAIN" ]]; then | ||
DUMP1090_CMD+=("--gain" "$RTLSDR_GAIN") | ||
fi | ||
|
||
fi | ||
|
||
# shellcheck disable=SC2016 | ||
"${DUMP1090_BIN}" "${DUMP1090_CMD[@]}" \ | ||
2>&1 | stdbuf -o0 awk '{print "[dump1090] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}' | ||
|
||
sleep 5 |