Skip to content

Commit

Permalink
feat(dump1090): add env var for additional args passed to dump1090 (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thom-x authored Jul 2, 2020
1 parent 7ad29dc commit abcd322
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
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

0 comments on commit abcd322

Please sign in to comment.