Skip to content
This repository was archived by the owner on Sep 19, 2021. It is now read-only.

Commit e1edf2e

Browse files
authored
Merge pull request #32 from google/update-run-server
Added Optional Param for Relay Address
2 parents ff2ac9b + 95c7cb0 commit e1edf2e

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

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)