Skip to content

Commit 95c7cb0

Browse files
committed
Added Optional Param for Relay Address
The java code supports an optional relay address but it was never passed through. This change adds support to the run_server script to pass through an optional relay address.
1 parent ff2ac9b commit 95c7cb0

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

run_server.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,23 @@
1717
TEAM_ID="$1"
1818
TEAM_SECRET="$2"
1919
PORT="$3"
20+
RELAY_ADDRESS="$4"
2021

2122
if [[ "TEAM_ID" == "" || "$TEAM_SECRET" == "" || "$PORT" == "" ]] ; then
22-
echo 'usage: <TEAM ID> <TEAM SECRET> <PORT>'
23+
echo 'usage: <TEAM ID> <TEAM SECRET> <PORT> [RELAY ADDRESS]'
2324
exit 1
2425
fi
2526

2627
cd './bin'
27-
java codeu.chat.ServerMain "$TEAM_ID" "$TEAM_SECRET" "$PORT"
28+
if [ "$RELAY_ADDRESS" == "" ] ; then
29+
java codeu.chat.ServerMain \
30+
"$TEAM_ID" \
31+
"$TEAM_SECRET" \
32+
"$PORT"
33+
else
34+
java codeu.chat.ServerMain \
35+
"$TEAM_ID" \
36+
"$TEAM_SECRET" \
37+
"$PORT" \
38+
"$RELAY_ADDRESS"
39+
fi

0 commit comments

Comments
 (0)