Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Run shellcheck during CI #135

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Shellcheck
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

permissions: {}

jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ludeeus/action-shellcheck@master
8 changes: 4 additions & 4 deletions endpoint/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ GATEWAY="${IP%.*}.2"
UNNEEDED_ROUTE="${IP%.*}.0"
echo "Endpoint's IPv4 address is $IP"

route add -net 193.167.0.0 netmask 255.255.0.0 gw $GATEWAY
route add -net 193.167.0.0 netmask 255.255.0.0 gw "$GATEWAY"
# delete unused route
route del -net $UNNEEDED_ROUTE netmask 255.255.255.0
route del -net "$UNNEEDED_ROUTE" netmask 255.255.255.0

# this relies on the IPv6 address being second in the "hostname -I" output
IP=$(hostname -I | cut -f2 -d" ")
GATEWAY="${IP%:*}:2"
UNNEEDED_ROUTE="${IP%:*}:"
echo "Endpoint's IPv6 address is $IP"

ip -d route add fd00:cafe:cafe::/48 via $GATEWAY
ip -d route add fd00:cafe:cafe::/48 via "$GATEWAY"
# delete unused route
ip -d route del $UNNEEDED_ROUTE/64
ip -d route del "$UNNEEDED_ROUTE/64"

# create the /logs and the /logs/qlog directory
mkdir -p /logs/qlog
12 changes: 6 additions & 6 deletions sim/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ ip6tables -A FORWARD -i eth0 -o eth1 -j DROP
ip6tables -A FORWARD -i eth1 -o eth0 -j DROP

if [[ -n "$WAITFORSERVER" ]]; then
wait-for-it-quic -t 10s $WAITFORSERVER
wait-for-it-quic -t 10s "$WAITFORSERVER"
fi

echo "Using scenario:" $SCENARIO
echo "Using scenario: $SCENARIO"

eval ./scratch/"$SCENARIO &"

PID=`jobs -p`
trap "kill -SIGINT $PID" INT
trap "kill -SIGTERM $PID" TERM
trap "kill -SIGKILL $PID" KILL
PID=$(jobs -p)
trap 'kill -SIGINT $PID' INT
trap 'kill -SIGTERM $PID' TERM
# SC2173: SIGKILL/SIGSTOP can not be trapped.
wait
Loading