Skip to content

Commit

Permalink
Merge pull request #41 from sdr-enthusiasts/fix-feeder
Browse files Browse the repository at this point in the history
Fix feeder
  • Loading branch information
fredclausen authored Dec 31, 2023
2 parents ceab429 + dbc7994 commit cd3d906
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
9 changes: 6 additions & 3 deletions rootfs/etc/s6-overlay/scripts/acars_feeder
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/command/with-contenv bash
# shellcheck shell=bash

# shellcheck disable=SC1091
source /scripts/common
SCRIPT_NAME="$(basename "$0")"
SCRIPT_NAME="${SCRIPT_NAME%.*}"

# shellcheck disable=SC2034
s6wrap=(s6wrap --quiet --timestamps --prepend="$SCRIPT_NAME" --args)

# Require that acars_server is running
if ! netstat -an | grep -P '^\s*tcp\s+\d+\s+\d+\s+0\.0\.0\.0:15550\s+(?>\d{1,3}\.{0,1}){4}:\*\s+LISTEN\s*$' > /dev/null; then
Expand All @@ -22,6 +25,6 @@ if [[ ! ${QUIET_LOGS,,} =~ true ]]; then
fi

# shellcheck disable=SC2016
"${s6wrap[@]}" socat -d TCP:127.0.0.1:15550 "$SERVER_ADDR"
socat -d TCP:127.0.0.1:15550 "$SERVER_ADDR"

sleep 5
11 changes: 2 additions & 9 deletions rootfs/etc/s6-overlay/scripts/acars_server
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
#!/command/with-contenv bash
#shellcheck shell=bash

# shellcheck disable=SC1091
source /scripts/common

set -o pipefail
set -e

# Listens for the output of acarsdec (UDP), and makes it available for multiple processes at TCP port 15550
# shellcheck disable=SC2016
# shellcheck disable=SC2154
"${s6wrap[@]}" socat -u udp-listen:5550,fork stdout | ncat -4 --keep-open --listen 0.0.0.0 15550

socat -u udp-listen:5550,fork stdout | ncat -4 --keep-open --listen 0.0.0.0 15550

sleep 5

0 comments on commit cd3d906

Please sign in to comment.