Skip to content

Commit

Permalink
make shellcheck happy (#208)
Browse files Browse the repository at this point in the history
* make shellcheck happy

* make shellcheck runnable on request

* make beast-splitter wait for data source and target on startup
  • Loading branch information
wiedehopf authored Oct 20, 2024
1 parent b9b9fd3 commit 053a5b2
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: Linting (Shellcheck)

on:
workflow_dispatch:
pull_request:
branches:
- main
Expand All @@ -11,7 +12,7 @@ jobs:
shellcheck:
name: Run shellcheck against shell scripts
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/[email protected]
- name: Pull koalaman/shellcheck:stable Image
Expand Down
1 change: 1 addition & 0 deletions rootfs/etc/init.d/beast-splitter
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/command/with-contenv sh
# shellcheck shell=sh

# "dummy" SysV-style init script, to allow piaware to restart beast-splitter.
# piaware calls SysV init script to restart beast-splitter (package/fa_services.tcl invoke_service_action).
Expand Down
1 change: 1 addition & 0 deletions rootfs/etc/init.d/dump1090
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/command/with-contenv sh
# shellcheck shell=sh

# "dummy" SysV-style init script, to allow piaware to restart dump1090.
# piaware calls SysV init script to restart dump1090 (package/fa_services.tcl invoke_service_action).
Expand Down
1 change: 1 addition & 0 deletions rootfs/etc/init.d/dump978
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/command/with-contenv sh
# shellcheck shell=sh

# "dummy" SysV-style init script, to allow piaware to restart dump978.
# piaware calls SysV init script to restart dump978 (package/fa_services.tcl invoke_service_action).
Expand Down
2 changes: 1 addition & 1 deletion rootfs/etc/s6-overlay/scripts/978raw-splitter
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/command/with-contenv bash
# shellcheck shell=bash
# shellcheck shell=bash disable=SC1091,2154
set -eo pipefail

source /scripts/common
Expand Down
13 changes: 12 additions & 1 deletion rootfs/etc/s6-overlay/scripts/beast-splitter
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/command/with-contenv bash
# shellcheck shell=bash
# shellcheck shell=bash disable=SC1091,2154
set -eo pipefail

source /scripts/common
Expand All @@ -14,5 +14,16 @@ BEASTSPLITTER_BIN="/usr/local/bin/beast-splitter"
BEASTSPLITTER_CMD=("--net" "$BEASTHOST:${BEASTPORT:-30005}")
BEASTSPLITTER_CMD+=("--connect" "127.0.0.1:30004")

# beast-splitter takes 60 seconds to reconnect
# wait for data source to be online
while ! nc -z "${BEASTHOST}" "${BEASTPORT:-30005}" >/dev/null 2>&1; do
sleep 1
done
# wait for dump1090 to be online
while ! nc -z 127.0.0.1 30004 >/dev/null 2>&1; do
sleep 1
done


# shellcheck disable=SC2016
exec "${s6wrap[@]}" "${BEASTSPLITTER_BIN}" "${BEASTSPLITTER_CMD[@]}"
2 changes: 1 addition & 1 deletion rootfs/etc/s6-overlay/scripts/dump1090
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/command/with-contenv bash
# shellcheck shell=bash
# shellcheck shell=bash disable=SC1091,2154
set -eo pipefail

source /scripts/common
Expand Down
2 changes: 1 addition & 1 deletion rootfs/etc/s6-overlay/scripts/dump978
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/command/with-contenv bash
#shellcheck shell=bash
# shellcheck shell=bash disable=SC1091,2154

source /scripts/common

Expand Down
2 changes: 1 addition & 1 deletion rootfs/etc/s6-overlay/scripts/piaware
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/command/with-contenv bash
# shellcheck shell=bash
# shellcheck shell=bash disable=SC1091,2154
set -eo pipefail

source /scripts/common
Expand Down
2 changes: 1 addition & 1 deletion rootfs/etc/s6-overlay/scripts/skyaware
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/command/with-contenv bash
# shellcheck shell=bash
# shellcheck shell=bash disable=SC1091,2154

# Depends on dump1090

Expand Down
2 changes: 1 addition & 1 deletion rootfs/etc/s6-overlay/scripts/skyaware978
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/command/with-contenv bash
#shellcheck shell=bash
# shellcheck shell=bash disable=SC1091,2154

source /scripts/common

Expand Down

0 comments on commit 053a5b2

Please sign in to comment.