Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dump1090): add env var for additional args passed to dump1090 #26

Merged
merged 1 commit into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down
11 changes: 10 additions & 1 deletion root/etc/services.d/dump1090/run
Original file line number Diff line number Diff line change
Expand Up @@ -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