forked from mars1211/rust-socketio
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart_test_server.sh
executable file
·71 lines (64 loc) · 1.86 KB
/
start_test_server.sh
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
echo "Starting test environment"
DEBUG=* node engine-io.js &
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start engine.io: $status"
exit $status
fi
echo "Successfully started engine.io instance"
DEBUG=* node engine-io-polling.js &
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start polling engine.io: $status"
exit $status
fi
echo "Successfully started polling engine.io instance"
DEBUG=* node socket-io.js &
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start socket.io: $status"
exit $status
fi
echo "Successfully started socket.io instance"
DEBUG=* node socket-io-auth.js &
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start socket.io auth: $status"
exit $status
fi
echo "Successfully started socket.io auth instance"
DEBUG=* node socket-io-restart.js &
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start socket.io restart: $status"
exit $status
fi
echo "Successfully started socket.io restart instance"
DEBUG=* node socket-io-restart-url-auth.js &
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start socket.io restart url auth: $status"
exit $status
fi
echo "Successfully started socket.io restart url auth instance"
DEBUG=* node engine-io-secure.js &
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start secure engine.io: $status"
exit $status
fi
echo "Successfully started secure engine.io instance"
while sleep 60; do
ps aux | grep socket | grep -q -v grep
PROCESS_1_STATUS=$?
ps aux | grep engine-io.js | grep -q -v grep
PROCESS_2_STATUS=$?
ps aux | grep engine-io-secure.js | grep -q -v grep
PROCESS_3_STATUS=$?
# If the greps above find anything, they exit with 0 status
# If they are not both 0, then something is wrong
if [ $PROCESS_1_STATUS -ne 0 -o $PROCESS_2_STATUS -ne 0 -o $PROCESS_3_STATUS -ne 0 ]; then
echo "One of the processes has already exited."
exit 1
fi
done