Skip to content

Commit

Permalink
add READSB_ENABLE_HEATMAP , do some clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
kx1t committed Oct 26, 2023
1 parent f093e58 commit e5ca69e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ All of the variables below are optional.
| `TAR1090_IMAGE_CONFIG_LINK` | An optional URL shown at the top of page, designed to be used for a link back to a configuration page. The token `HOSTNAME` in the link is replaced with the current host that tar1090 is accessed on. | `null` |
| `TAR1090_IMAGE_CONFIG_TEXT` | Text to display for the config link | `null` |
| `TAR1090_DISABLE` | Set to `true` to disable the web server and all websites (including the map, `graphs1090`, `heatmap`, `pTracks`, etc.) | Unset |
| `READSB_ENABLE_HEATMAP` | Set to `true` or leave unset to enable the HeatMap function available at `http://myip/?Heatmap`; set to `false` to disable the HeapMap function | `true` (enabled) |

- For documentation on the aircraft.json format see this page: <https://github.com/wiedehopf/readsb/blob/dev/README-json.md>
- TAR1090_ENABLE_AC_DB causes readsb to load the tar1090 database as a csv file from this repository: <https://github.com/wiedehopf/tar1090-db/tree/csv>
Expand Down
58 changes: 29 additions & 29 deletions rootfs/etc/s6-overlay/scripts/readsb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# shellcheck shell=bash disable=SC1091,SC2076

source /scripts/common


mkdir -p /run/readsb

s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args)

# Build the readsb command line based on options
READSB_BIN="/usr/local/bin/readsb"

Expand Down Expand Up @@ -41,8 +41,6 @@ if [ -n "${UUID}" ]; then
fi

READSB_CMD+=("--write-json=/run/readsb")
READSB_CMD+=("--heatmap-dir=/var/globe_history")
READSB_CMD+=("--heatmap=15")
READSB_CMD+=("--write-state=/var/globe_history")
READSB_CMD+=("--json-trace-interval=15")
READSB_CMD+=("--json-reliable=1")
Expand All @@ -58,16 +56,21 @@ READSB_CMD+=("--net-json-port=30047")
# READSB_CMD+=(--forward-mlat)
READSB_CMD+=(--net-sbs-in-port=32006)

if [[ -n "${READSB_FORWARD_MLAT}" ]]; then
echo "[$(date +"%Y-%m-%d %H:%M:%S")][readsb] WARNING -- READSB_FORWARD_MLAT has been set! Do not feed the output of this container to any aggregators!"
if chk_enabled "${READSB_ENABLE_HEATMAP:-true}"; then
READSB_CMD+=("--heatmap-dir=/var/globe_history")
READSB_CMD+=("--heatmap=${READSB_HEATMAP_INTERVAL:-15}")
fi

if chk_enabled "${READSB_FORWARD_MLAT}"; then
"${s6wrap[@]}" echo "WARNING -- READSB_FORWARD_MLAT has been set! Do not feed the output of this container to any aggregators!"
READSB_CMD+=("--forward-mlat")
fi

if [[ -n "${READSB_FORWARD_MLAT_SBS}" ]] && [[ "${READSB_FORWARD_MLAT_SBS,,}" != "false" ]] && [[ "${READSB_FORWARD_MLAT_SBS,,}" != "off" ]]; then
echo "[$(date +"%Y-%m-%d %H:%M:%S")][readsb] WARNING -- READSB_FORWARD_MLAT_SBS has been set! Do not feed the SBS (BaseStation) output of this container to any aggregators!"
if chk_enabled "${READSB_FORWARD_MLAT_SBS}"; then
"${s6wrap[@]}" echo "WARNING -- READSB_FORWARD_MLAT_SBS has been set! Do not feed the SBS (BaseStation) output of this container to any aggregators!"
READSB_CMD+=("--forward-mlat-sbs")
elif [[ -n "${READSB_FORWARD_MLAT}" ]] && [[ "${READSB_FORWARD_MLAT_SBS,,}" != "false" ]] && [[ "${READSB_FORWARD_MLAT_SBS,,}" != "off" ]]; then
echo "[$(date +"%Y-%m-%d %H:%M:%S")][readsb] WARNING -- READSB_FORWARD_MLAT_SBS has been set! Do not feed the SBS (BaseStation) output of this container to any aggregators!"
elif chk_enabled "${READSB_FORWARD_MLAT}"; then
"${s6wrap[@]}" echo "WARNING -- READSB_FORWARD_MLAT_SBS has been set! Do not feed the SBS (BaseStation) output of this container to any aggregators!"
READSB_CMD+=("--forward-mlat-sbs")
fi

Expand All @@ -84,7 +87,7 @@ if [ -n "${READSB_DEBUG}" ]; then
fi

# Handle --write-state-only-on-exit
if [ -n "${READSB_WRITE_STATE_ONLY_ON_EXIT}" ]; then
if chk_enabled "${READSB_WRITE_STATE_ONLY_ON_EXIT}"; then
READSB_CMD+=("--write-state-only-on-exit")
fi

Expand All @@ -94,12 +97,13 @@ if [[ -n "$READSB_MAX_RANGE" ]]; then
fi

# Handle "--mlat"
if [[ -n "$READSB_MLAT" ]]; then
#shellcheck disable=SC2153
if chk_enabled "$READSB_MLAT"; then
READSB_CMD+=("--mlat")
fi

# Handle "--modeac"
if [[ -n "$READSB_MODEAC" ]]; then
if chk_enabled "$READSB_MODEAC"; then
READSB_CMD+=("--modeac")
fi

Expand All @@ -109,7 +113,7 @@ if [[ -n "$READSB_STATS_EVERY" ]]; then
fi

# Handle "--stats-range"
if [[ -n "$READSB_STATS_RANGE" ]]; then
if chk_enabled "$READSB_STATS_RANGE"; then
READSB_CMD+=("--stats-range")
fi

Expand Down Expand Up @@ -140,7 +144,7 @@ if [[ -n "$READSB_NET_BEAST_REDUCE_OUT_PORT" ]]; then
READSB_CMD+=("--net-beast-reduce-out-port=$READSB_NET_BEAST_REDUCE_OUT_PORT")
fi

if [[ -n "$READSB_NET_SBS_REDUCE" ]]; then
if chk_enabled "$READSB_NET_SBS_REDUCE"; then
READSB_CMD+=("--net-sbs-reduce")
fi

Expand All @@ -152,10 +156,6 @@ if [[ -n "$READSB_JSON_TRACE_INTERVAL" ]]; then
READSB_CMD+=("--json-trace-interval=$READSB_JSON_TRACE_INTERVAL")
fi

if [[ -n "$READSB_HEATMAP_INTERVAL" ]]; then
READSB_CMD+=("--heatmap=$READSB_HEATMAP_INTERVAL")
fi

if [[ -n "$READSB_NET_BEAST_REDUCE_FILTER_ALT" ]]; then
READSB_CMD+=("--net-beast-reduce-filter-alt=$READSB_NET_BEAST_REDUCE_FILTER_ALT")
fi
Expand Down Expand Up @@ -225,7 +225,7 @@ if [[ -n "$READSB_NET_SBS_OUTPUT_PORT" ]]; then
fi

# Handle "--net-verbatim"
if [[ -n "$REASSB_NET_VERBATIM" ]]; then
if chk_enabled "$READSB_NET_VERBATIM"; then
READSB_CMD+=("--net-verbatim")
fi

Expand Down Expand Up @@ -265,7 +265,7 @@ if [[ -n "$READSB_RTLSDR_DEVICE" ]]; then
fi

# Handle "--enable-agc"
if [[ -n "$READSB_RTLSDR_ENABLE_AGC" ]]; then
if chk_enabled "$READSB_RTLSDR_ENABLE_AGC"; then
READSB_CMD+=("--enable-agc")
fi

Expand All @@ -277,32 +277,32 @@ fi
##### MODE-S BEAST OPTIONS #####

# Handle "--beast-crc-off"
if [[ -n "$READSB_BEAST_CRC_OFF" ]]; then
if chk_enabled "$READSB_BEAST_CRC_OFF"; then
READSB_CMD+=("--beast-crc-off")
fi

# Handle "--beast-df045-on"
if [[ -n "$READSB_BEAST_DF045_ON" ]]; then
if chk_enabled "$READSB_BEAST_DF045_ON"; then
READSB_CMD+=("--beast-df045-on")
fi

# Handle "--beast-df1117-on"
if [[ -n "$READSB_BEAST_DF1117_ON" ]]; then
if chk_enabled "$READSB_BEAST_DF1117_ON"; then
READSB_CMD+=("--beast-df1117-on")
fi

# Handle "--beast-fec-off"
if [[ -n "$READSB_BEAST_FEC_OFF" ]]; then
if chk_enabled "$READSB_BEAST_FEC_OFF"; then
READSB_CMD+=("--beast-fec-off")
fi

# Handle "--beast-mlat-off"
if [[ -n "$READSB_BEAST_MLAT_OFF" ]]; then
if chk_enabled "$READSB_BEAST_MLAT_OFF"; then
READSB_CMD+=("--beast-mlat-off")
fi

# Handle "--beast-modeac"
if [[ -n "$READSB_BEAST_MODEAC" ]]; then
if chk_enabled "$READSB_BEAST_MODEAC"; then
READSB_CMD+=("--beast-modeac")
fi

Expand All @@ -318,9 +318,9 @@ fi
#####################
# Handle --write-prom=<filepath>

if [[ -n "$PROMETHEUS_ENABLE" ]]; then
if chk_enabled "$PROMETHEUS_ENABLE"; then
READSB_CMD+=("--write-prom=/run/readsb-prometheus.prom")
fi

# shellcheck disable=SC2086
exec s6wrap --quiet --prepend=readsb --timestamps --args "${READSB_BIN}" "${READSB_CMD[@]}" $READSB_EXTRA_ARGS
"${s6wrap[@]}" "${READSB_BIN}" "${READSB_CMD[@]}" $READSB_EXTRA_ARGS

0 comments on commit e5ca69e

Please sign in to comment.