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

Commit 4bed29f

Browse files
committed
Improved messaging of variables in run_server.sh
This change improves the messaging for each variable in that the run_server.sh script expects. Running ther script with any value missing will yield a usage message.
1 parent a905bf9 commit 4bed29f

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

run_server.sh

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,41 @@
1717
TEAM_ID="$1"
1818
TEAM_SECRET="$2"
1919
PORT="$3"
20-
PERSISTENT="$4"
20+
PERSISTENT_DIR="$4"
2121
RELAY_ADDRESS="$5"
2222

23-
if [[ "TEAM_ID" == "" || "$TEAM_SECRET" == "" || "$PORT" == "" || "$PERSISTENT" == "" ]] ; then
24-
echo 'usage: <TEAM ID> <TEAM SECRET> <PORT> <PERSISENT> [RELAY ADDRESS]'
23+
if [[ "$TEAM_ID" == "" || "$TEAM_SECRET" == "" || "$PORT" == "" || "$PERSISTENT_DIR" == "" ]] ; then
24+
echo 'usage: <TEAM ID> <TEAM SECRET> <PORT> <PERSISTENT> [RELAY ADDRESS]'
25+
echo ''
26+
echo 'TEAM ID : The id registered with the relay server. If you are'
27+
echo ' not connecting to a relay server, use "100".'
28+
echo 'TEAM SECRET : The secret registerd with the relay server. If you are'
29+
echo ' not connecting to a relay server, use "ABABAB".'
30+
echo 'PORT : The port that the server will listen to for incoming '
31+
echo ' connections. This can be anything from 1024 to 65535.'
32+
echo 'PERSISTENT DIR : The directory where the server can save data that will'
33+
echo ' exists between runs.'
34+
echo 'RELAY ADDRESS : This value is optional. If you want to connect to a '
35+
echo ' relay server, the address must be IP@PORT where IP is'
36+
echo ' the ip address of the relay server and PORT is the port'
37+
echo ' the relay server is listing on.'
38+
echo ''
2539
exit 1
2640
fi
2741

42+
2843
cd './bin'
2944
if [ "$RELAY_ADDRESS" == "" ] ; then
3045
java codeu.chat.ServerMain \
3146
"$TEAM_ID" \
3247
"$TEAM_SECRET" \
3348
"$PORT" \
34-
"$PERSISTENT"
49+
"$PERSISTENT_DIR"
3550
else
3651
java codeu.chat.ServerMain \
3752
"$TEAM_ID" \
3853
"$TEAM_SECRET" \
3954
"$PORT" \
40-
"$PERSISTENT" \
55+
"$PERSISTENT_DIR" \
4156
"$RELAY_ADDRESS"
4257
fi

0 commit comments

Comments
 (0)