Browse Source

Merge pull request #693 from eesast/dev

Update run.sh
main
xiangmy21 GitHub 1 year ago
parent
commit
3b71c41f26
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      dependency/shell/run.sh

+ 6
- 6
dependency/shell/run.sh View File

@@ -54,9 +54,9 @@ read_array() {

function retry_command {
local command="$1"
local max_attempts=10
local max_attempts=5
local attempt_num=1
local sleep_seconds=5
local sleep_seconds=10

while [ $attempt_num -le $max_attempts ]; do
echo "Attempt $attempt_num / $max_attempts to run command: $command"
@@ -174,7 +174,7 @@ elif [ "$TERMINAL" = "CLIENT" ]; then
cp -r $python_main_dir $python_main_dir$i
cp -f ./$code_name.py $python_main_dir$i/PyAPI/AI.py

command="nice -0 python3 $python_main_dir$i/PyAPI/main.py -I $CONNECT_IP -P $PORT -p $j > $playback_dir/team$k-player$j.log 2>&1"
command="nice -0 python3 $python_main_dir$i/PyAPI/main.py -I $CONNECT_IP -P $PORT -p $j > $playback_dir/team$k-player$j.log 2>&1 &"

retry_command "$command" &

@@ -183,7 +183,7 @@ elif [ "$TERMINAL" = "CLIENT" ]; then
elif [ -f "./$code_name" ]; then
echo "find ./$code_name"

command="nice -0 ./$code_name -I $CONNECT_IP -P $PORT -p $j > $playback_dir/team$k-player$j.log 2>&1"
command="nice -0 ./$code_name -I $CONNECT_IP -P $PORT -p $j > $playback_dir/team$k-player$j.log 2>&1 &"
retry_command "$command" &

ps -aux |grep $code_name
@@ -201,7 +201,7 @@ elif [ "$TERMINAL" = "CLIENT" ]; then
cp -r $python_main_dir $python_main_dir$i
cp -f ./$code_name.py $python_main_dir$i/PyAPI/AI.py

command="nice -0 python3 $python_main_dir$i/PyAPI/main.py -I $CONNECT_IP -P $PORT -p $j > $playback_dir/team$k-player$j.log 2>&1"
command="nice -0 python3 $python_main_dir$i/PyAPI/main.py -I $CONNECT_IP -P $PORT -p $j > $playback_dir/team$k-player$j.log 2>&1 &"

retry_command "$command" &

@@ -209,7 +209,7 @@ elif [ "$TERMINAL" = "CLIENT" ]; then
elif [ -f "./$code_name" ]; then
echo "find ./$code_name"

command="nice -0 ./$code_name -I $CONNECT_IP -P $PORT -p $j > $playback_dir/team$k-player$j.log 2>&1"
command="nice -0 ./$code_name -I $CONNECT_IP -P $PORT -p $j > $playback_dir/team$k-player$j.log 2>&1 &"

retry_command "$command" &



Loading…
Cancel
Save