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.

27 lines
676 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. read -p "Are you sure? [y/n]" -n 1 -r
  13. echo
  14. if [[ $REPLY =~ ^[Yy]$ ]]; then
  15. response=`curl --user :2aaFCkjNIDHAsAIh9iQHc+Y+FGhkM5Z0RQgpO6TL6EA= -X POST -H "Content-Type: application/json" -d "$OUTPUT" https://davar.icfpcontest.org/teams/235/solutions`
  16. if [ "$response" == "created" ]; then
  17. echo "submitted"
  18. else
  19. echo $response
  20. echo "error with server"
  21. fi
  22. else
  23. echo "submission aborted"
  24. fi
  25. else
  26. echo "error in vm execution"
  27. fi