You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
888 B

  1. #!/bin/bash
  2. if [ $# -lt 1 ]; then
  3. echo "Missing json filename"
  4. exit 1
  5. fi
  6. if [ $# -lt 2 ]; then
  7. echo "Missing strategy name"
  8. exit 1
  9. fi
  10. OUTPUT=`dist/build/icfp2015/icfp2015 -f $1|./filterResults.py $2`
  11. if [ $? -eq 0 ]; then
  12. problem=`echo $1 | cut -d '_' -f 3`
  13. if [ "$OUTPUT" == "`cat submitted/$problem 2> /dev/null`" ]; then
  14. echo "Same solutions alredy submitted, quitting"
  15. exit 0
  16. fi
  17. read -p "Are you sure? [y/n]" -n 1 -r
  18. echo
  19. echo $OUTPUT > submitted/$problem
  20. if [[ $REPLY =~ ^[Yy]$ ]]; then
  21. exit 1
  22. response=`curl --user :2aaFCkjNIDHAsAIh9iQHc+Y+FGhkM5Z0RQgpO6TL6EA= -X POST -H "Content-Type: application/json" -d "$OUTPUT" https://davar.icfpcontest.org/teams/235/solutions`
  23. if [ "$response" == "created" ]; then
  24. echo "Submitted"
  25. else
  26. echo $response
  27. echo "Error with server"
  28. fi
  29. else
  30. echo "Submission aborted"
  31. fi
  32. else
  33. echo "Error in vm execution"
  34. fi