forked from smcameron/space-nerds-in-space
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quickjoin
executable file
·49 lines (41 loc) · 930 Bytes
/
quickjoin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
usage()
{
echo "usage: quickjoin star-ship-name password" 1>&2
echo "example:" 1>&2
echo "./quickjoin Enterprise tribbles" 1>&2
exit 1
}
shipname="$1"
if [ "$1" = "" ]
then
shipname="spacenerd"
fi
password="$2"
if [ "$2" = "" ]
then
password="spacenerd"
fi
# check if lobby server is running
ps aux | grep 'ssgl_server' | grep -v grep > /dev/null 2>&1
if [ "$?" != "0" ]
then
echo "Starting lobby server"
ssgl/ssgl_server
sleep 0.25
else
echo "lobby server already running."
fi
# check if SNIS server is running
ps aux | grep 'snis_server' | grep -v grep > /dev/null 2>&1
if [ "$?" != "0" ]
then
echo "Starting SNIS server"
./snis_server localhost SPACENERDS `hostname` localhost --enable-enscript &
sleep 0.25
else
echo "SNIS server already running."
fi
# start the game client and server in quickstart mode
./snis_client --fullscreen --quickstart --starship "$shipname" --pw "$password"
exit $?