3 # This is only to ensure I write no unintentional bashisms.
6 # Abort the script on error.
9 # Use the shell script's arguments to the server's arguments.
10 ./roguelike-server $@ &
12 # Give server some time to start up and exit on error.
15 # The client should not start if the server is not running. (If the server was
16 # running in the foreround, any error exit of it so far would be caught by "set
17 # -e" above. But "set -e" is blind to error codes generated in the background.)
18 kill -0 $! 2> /dev/null
20 # Give server some time (max. 10 seconds) to generate its out file.
22 while [ ! -e server/out ] && [ $i -le 10000 ]
27 kill -0 $! 2> /dev/null
29 # Only start the interface when everything else went well.