-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates to use s6 wrap and remove serial detection
- Loading branch information
1 parent
6b166a8
commit 931a898
Showing
7 changed files
with
51 additions
and
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
#!/command/with-contenv bash | ||
#shellcheck shell=bash | ||
|
||
# shellcheck disable=SC1091 | ||
source /scripts/common | ||
|
||
# if GDB is set, install GDB | ||
|
||
if [ -n "$GDB" ]; then | ||
echo "Installing GDB" | ||
apt-get update && apt-get install -y gdb | ||
# shellcheck disable=SC2154 | ||
"${s6wrap[@]}" echo "Installing GDB" | ||
"${s6wrap[@]}" apt-get update && apt-get install -y gdb | ||
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
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,21 +1,26 @@ | ||
#!/command/with-contenv bash | ||
# shellcheck shell=bash | ||
|
||
SCRIPT_NAME="$(basename "$0")" | ||
SCRIPT_NAME="${SCRIPT_NAME%.*}" | ||
|
||
# shellcheck disable=SC2034 | ||
s6wrap=(s6wrap --quiet --timestamps --prepend="$SCRIPT_NAME" --args) | ||
|
||
set -o pipefail | ||
|
||
# Require that vdlm_server is running | ||
if ! netstat -an | grep -P '^\s*tcp\s+\d+\s+\d+\s+0\.0\.0\.0:15555\s+(?>\d{1,3}\.{0,1}){4}:\*\s+LISTEN\s*$' > /dev/null; then | ||
sleep 1 | ||
if [[ ! ${QUIET_LOGS,,} =~ true ]]; then | ||
echo "[vdlm_feeder] vdlm_server not running, exiting" | ||
"${s6wrap[@]}" echo "vdlm_server not running, exiting" | ||
fi | ||
exit | ||
fi | ||
set -e | ||
|
||
SERVER_ADDR="UDP:${SERVER}:${SERVER_PORT}" | ||
# shellcheck disable=SC2016 | ||
socat -d TCP:127.0.0.1:15555 "$SERVER_ADDR" \ | ||
2>&1 | stdbuf -oL awk '{print "[vdlm_feeder] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}' | ||
socat -d TCP:127.0.0.1:15555 "$SERVER_ADDR" | ||
|
||
sleep 5 |
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,12 +1,11 @@ | ||
#!/command/with-contenv bash | ||
#shellcheck shell=bash | ||
|
||
set -o pipefail | ||
set -e | ||
set -o pipefail | ||
set -e | ||
|
||
# Listens for the output of vdlm2dec (UDP), and makes it available for multiple processes at TCP port 15555 | ||
# shellcheck disable=SC2016 | ||
socat -u udp-listen:5555,fork stdout | ncat -4 --keep-open --listen 0.0.0.0 15555 \ | ||
2>&1 | stdbuf -oL awk '{print "[acars_server] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}' | ||
# Listens for the output of vdlm2dec (UDP), and makes it available for multiple processes at TCP port 15555 | ||
# shellcheck disable=SC2016 | ||
socat -u udp-listen:5555,fork stdout | ncat -4 --keep-open --listen 0.0.0.0 15555 | ||
|
||
sleep 5 | ||
sleep 5 |
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 was deleted.
Oops, something went wrong.