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.

33 lines
879 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. response=`curl --user :2aaFCkjNIDHAsAIh9iQHc+Y+FGhkM5Z0RQgpO6TL6EA= -X POST -H "Content-Type: application/json" -d "$OUTPUT" https://davar.icfpcontest.org/teams/235/solutions`
  22. if [ "$response" == "created" ]; then
  23. echo "Submitted"
  24. else
  25. echo $response
  26. echo "Error with server"
  27. fi
  28. else
  29. echo "Submission aborted"
  30. fi
  31. else
  32. echo "Error in vm execution"
  33. fi