diff --git a/dependency/shell/run.sh b/dependency/shell/run.sh index 89f35a3e..bb10d6d1 100644 --- a/dependency/shell/run.sh +++ b/dependency/shell/run.sh @@ -64,11 +64,11 @@ function retry_command { sleep $sleep_seconds if kill -0 $PID 2>/dev/null; then - echo "Connected to server successfully." - return 0 - else echo "Failed to connect to server. Retrying..." ((attempt_num++)) + else + echo "Connected to server successfully." + return 0 fi done @@ -106,6 +106,7 @@ if [ "$TERMINAL" = "SERVER" ]; then finish_payload='{"result": {"status": "Crashed", "scores": [0, 0]}}' curl $FINISH_URL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d "${finish_payload}" > $playback_dir/send.log 2>&1 else + echo "Game is started." ps -p $server_pid while [ $? -eq 0 ] do