From 12add9001dc3f62e3e5e77ce39fe826a6ab29881 Mon Sep 17 00:00:00 2001 From: xiangmy21 <90919434+xiangmy21@users.noreply.github.com> Date: Wed, 8 May 2024 02:42:50 +0800 Subject: [PATCH] Update run.sh --- dependency/shell/run.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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