From abcd3229cdb5427687a7b16fc005498189d6be23 Mon Sep 17 00:00:00 2001 From: MAUGIN Thomas Date: Thu, 2 Jul 2020 09:49:35 +0200 Subject: [PATCH] feat(dump1090): add env var for additional args passed to dump1090 (#26) --- README.md | 16 ++++++++-------- root/etc/services.d/dump1090/run | 11 ++++++++++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 50ea63a..598f41e 100644 --- a/README.md +++ b/README.md @@ -127,14 +127,14 @@ Example : | `FR24FEED_TEST_DASH_TEST=value` | `test-test` | `value2` | `fr24feed.init` | | `PIAWARE_TEST=value` | `test` | `value` | `piaware.conf` | -## Dump1090 -### Receiver location - -| Environment Variable | Default value | -|---------------------------------------|--------------------------| -| `HTML_SITE_LAT` | `45.0` | -| `HTML_SITE_LON` | `9.0` | -| `HTML_SITE_NAME` | `My Radar Site` | +## Dump1090 & Web UI + +| Environment Variable | Default value | Description | +|---------------------------------------|--------------------------|-------------------------------------------------------------------| +| `HTML_SITE_LAT` | `45.0` | | +| `HTML_SITE_LON` | `9.0` | | +| `HTML_SITE_NAME` | `My Radar Site` | | +| `DUMP1090_ADDITIONAL_ARGS` | empty | Additial arguments for dump1090 e.g.: `--json-location-accuracy 2`| Ex : `-e "HTML_SITE_NAME=My site"` diff --git a/root/etc/services.d/dump1090/run b/root/etc/services.d/dump1090/run index a63a5ee..c92547f 100644 --- a/root/etc/services.d/dump1090/run +++ b/root/etc/services.d/dump1090/run @@ -9,9 +9,18 @@ then printf -v $key -- "$value" export $key } + default_value2() + { + key=${1//\-/_DASH_} + key=DUMP1090_${key^^} + eval "value=\${$key:-\$2}" + printf -v $key -- "$value" + export $key + } default_value "site_lat" "45.0" default_value "site_lon" "9.0" - /usr/lib/fr24/dump1090 --net --write-json /usr/lib/fr24/public_html/data --raw --quiet --lat ${HTML_SITE_LAT} --lon ${HTML_SITE_LON} + default_value2 "additional_args" "" + /usr/lib/fr24/dump1090 --net --write-json /usr/lib/fr24/public_html/data --raw --quiet --lat ${HTML_SITE_LAT} --lon ${HTML_SITE_LON} ${DUMP1090_ADDITIONAL_ARGS} else tail -f /dev/null fi