Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. RED='\033[0;31m'
  4. GREEN='\033[0;32m'
  5. WHITE='\033[0;37m'
  6.  
  7. if [ "$#" -ne 3 ]
  8. then
  9. echo "usage: $0 path_to_key nb_team nb_players_per_team"
  10. exit 1
  11. fi
  12.  
  13.  
  14. ./lemipc $1 0 &
  15.  
  16. pids=$!
  17.  
  18.  
  19. for teamNb in $(eval echo {1..$2})
  20. do
  21. for playerNb in $(eval echo {1..$3})
  22. do
  23. ./lemipc $1 $teamNb > /dev/null &
  24. pids+=" $!"
  25. done
  26. done
  27.  
  28. failed=0
  29.  
  30. for p in $pids
  31. do
  32. if ! wait $p
  33. then
  34. echo -e "${RED}Process with pid $p Stopped with bad exit code${WHITE}"
  35. failed=1
  36. fi
  37. done
  38.  
  39. if [ $failed -eq 1 ]
  40. then
  41. echo -e "${RED}Tests Failed !${WHITE}"
  42. exit 1
  43. else
  44. echo -e "${GREEN}Tests were successful !${WHITE}"
  45. exit 0
  46. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement