reconnect.sh 851 B

123456789101112131415161718192021
  1. #!/usr/bin/env bash
  2. echo "Starting node 1"
  3. DEBUG_DISCOVERY=7 DEBUG=7 python3 main.py --node-id "node1" --listen-port 5678 --broadcast-port 5679 --chatgpt-api-port 52415 --chatgpt-api-response-timeout 900 > output1.log 2>&1 &
  4. PID1=$!
  5. echo "Started node 1 PID: $PID1"
  6. echo "Starting node 2"
  7. DEBUG_DISCOVERY=7 DEBUG=7 python3 main.py --node-id "node2" --listen-port 5679 --broadcast-port 5678 --chatgpt-api-port 8001 --chatgpt-api-response-timeout 900 > output2.log 2>&1 &
  8. PID2=$!
  9. echo "Started node 2 PID: $PID2"
  10. sleep 5
  11. kill $PID2
  12. sleep 5
  13. echo "Starting node 2 again..."
  14. DEBUG_DISCOVERY=7 DEBUG=7 python3 main.py --node-id "node2" --listen-port 5679 --broadcast-port 5678 --chatgpt-api-port 8001 --chatgpt-api-response-timeout 900 > output3.log 2>&1 &
  15. PID2=$!
  16. sleep 5
  17. echo "Killing nodes and ending test..."
  18. kill $PID1
  19. kill $PID2
  20. echo "Test complete."