-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from mikenye/dev
Fix issue #4
- Loading branch information
Showing
4 changed files
with
45 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
#!/usr/bin/with-contenv sh | ||
# shellcheck shell=sh | ||
#!/usr/bin/with-contenv bash | ||
# shellcheck shell=bash | ||
|
||
# Define colours | ||
YELLOW='\033[1;33m' | ||
LIGHTRED='\033[1;31m' | ||
NOCOLOR='\033[0m' | ||
|
||
# Check to make sure the correct command line arguments have been set | ||
EXITCODE=0 | ||
if [ -z "${BEASTHOST}" ]; then | ||
echo "ERROR: BEASTHOST environment variable not set" | ||
echo -e "${LIGHTRED}ERROR: BEASTHOST environment variable not set${NOCOLOR}" | ||
EXITCODE=1 | ||
fi | ||
if [ -z "${LAT}" ]; then | ||
echo -e "${YELLOW}WARNING: LAT environment variable not set, Home location will not be accurate${NOCOLOR}" | ||
fi | ||
if [ -z "${LONG}" ]; then | ||
echo -e "${YELLOW}WARNING: LONG environment variable not set, Home location will not be accurate${NOCOLOR}" | ||
fi | ||
if [ $EXITCODE -ne 0 ]; then | ||
exit 1 | ||
fi | ||
|
||
# Set up timezone | ||
if [ -z "${TZ}" ]; then | ||
echo "WARNING: TZ environment variable not set" | ||
echo "${YELLOW}WARNING: TZ environment variable not set${NOCOLOR}" | ||
else | ||
ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && echo "$TZ" >/etc/timezone | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
#!/usr/bin/with-contenv bash | ||
# shellcheck shell=bash | ||
|
||
exec \ | ||
/usr/local/bin/readsb \ | ||
--net-only \ | ||
--write-json=/run/readsb \ | ||
--quiet \ | ||
--stats-every=3600 \ | ||
--net-connector="${BEASTHOST}","${BEASTPORT}",beast_in \ | ||
2>&1 | awk -W interactive '{print "[readsb] " $0}' | ||
# Build the readsb command line based on options | ||
READSB_BIN="/usr/local/bin/readsb" | ||
|
||
READSB_CMD=(--net-only) | ||
READSB_CMD+=(--quiet) | ||
|
||
if [ ! -z "${LAT}" ]; then | ||
READSB_CMD+=(--lat "${LAT}") | ||
fi | ||
|
||
if [ ! -z "${LONG}" ]; then | ||
READSB_CMD+=(--lon "${LONG}") | ||
fi | ||
|
||
READSB_CMD+=(--write-json=/run/readsb) | ||
READSB_CMD+=(--stats-every=3600) | ||
READSB_CMD+=(--net-connector="${BEASTHOST}","${BEASTPORT}",beast_in) | ||
|
||
"${READSB_BIN}" "${READSB_CMD[@]}" 2>&1 | awk -W Interactive '{print "[readsb] " $0}' |