From f413d8fe914f8567bb55c0b21745ad29b4a686c6 Mon Sep 17 00:00:00 2001 From: wiedehopf Date: Tue, 5 Nov 2024 17:35:36 +0100 Subject: [PATCH] add option to disable MLAT (#85) currently MLAT can't be disabled contrary to the readme --- README.md | 3 ++- docker-compose.yml | 3 ++- rootfs/etc/s6-overlay/scripts/55-mlat-client | 4 ++++ rootfs/etc/s6-overlay/scripts/mlat-client | 5 +++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 414ef17..dde4322 100644 --- a/README.md +++ b/README.md @@ -86,10 +86,11 @@ To add `RadarVirtuel` to an existing Docker Stack, simply copy and paste the rel | `LAT` | This is your station latitude (used with MLAT) | | | `LON` | This is your station longitude (used with MLAT) | | | `ALT` | This is your antenna altitude above the ellipsoid (MSL). Use "ft" for feet or "m" for meters | | +| `ENABLE_MLAT` | Enable MLAT | `true` (default) / `false` | ## MLAT Configuration -By default, MLAT is switched ON in the container. Please make sure to configure a valid `MLAT_HOST`, `LAT`, `LON`, and `ALT` in your `docker-compose.yml` setup. If you want to switch off MLAT, simply set `MLAT_HOST` to empty. You will see a message in the logs encouraging to configure MLAT, followed by a message saying that MLAT is disabled. +By default, MLAT is switched ON in the container. Please make sure to configure a valid `MLAT_HOST`, `LAT`, `LON`, and `ALT` in your `docker-compose.yml` setup. If you want to switch off MLAT, simply set `ENABLE_MLAT` to false. ## Timezone configuration diff --git a/docker-compose.yml b/docker-compose.yml index bd1c112..d192a24 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,7 +28,8 @@ services: - FEEDER_KEY=${RV_FEEDER_KEY} - SOURCE_HOST=${HOSTNAME}:30002 - RV_SERVER=mg2.adsbnetwork.com:50050 - # MLAT related params; set "MLAT_HOST=" (empty) to disable MLAT + # MLAT related params + - ENABLE_MLAT=true - MLAT_HOST=${HOSTNAME}:30005 - MLAT_SERVER=mlat.adsbnetwork.com:50000 - LAT=${FEEDER_LAT} diff --git a/rootfs/etc/s6-overlay/scripts/55-mlat-client b/rootfs/etc/s6-overlay/scripts/55-mlat-client index fd26a97..295a9f6 100755 --- a/rootfs/etc/s6-overlay/scripts/55-mlat-client +++ b/rootfs/etc/s6-overlay/scripts/55-mlat-client @@ -19,6 +19,10 @@ source /scripts/common +if chk_disabled "${ENABLE_MLAT}"; then + exit 0 +fi + "${s6wrap[@]}" echo "Initializing mlat-client..." MLAT_FLAG="/run/mlat-down" diff --git a/rootfs/etc/s6-overlay/scripts/mlat-client b/rootfs/etc/s6-overlay/scripts/mlat-client index 26a99be..6737be7 100755 --- a/rootfs/etc/s6-overlay/scripts/mlat-client +++ b/rootfs/etc/s6-overlay/scripts/mlat-client @@ -19,6 +19,11 @@ source /scripts/common +if chk_disabled "${ENABLE_MLAT}"; then + "${s6wrap[@]}" echo "MLAT is DISABLED (ENABLE_MLAT set to $ENABLE_MLAT)" + stop_service +fi + "${s6wrap[@]}" echo "Started as an s6 service" MLAT_CMD="/usr/local/bin/mlat-client"