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.

23 lines
583 B

  1. #!/bin/bash
  2. if [ $# -lt 1 ]; then
  3. echo "missing json filename"
  4. exit 1
  5. fi
  6. OUTPUT=`vm/Main0.hs -f $1`
  7. if [ $? -eq 0 ]; then
  8. read -p "Are you sure? [y/n]" -n 1 -r
  9. echo
  10. if [[ $REPLY =~ ^[Yy]$ ]]; then
  11. echo "submitting solution"
  12. response=`curl --user :2aaFCkjNIDHAsAIh9iQHc+Y+FGhkM5Z0RQgpO6TL6EA= -X POST -H "Content-Type: application/json" -d $OUTPUT https://davar.icfpcontest.org/teams/235/solutions`
  13. if [ "$response" == "created" ]; then
  14. echo "submitted"
  15. else
  16. echo "error with server"
  17. fi
  18. else
  19. echo "submission aborted"
  20. fi
  21. else
  22. echo "error in vm execution"
  23. fi