aboutsummaryrefslogtreecommitdiff
path: root/upload.sh
diff options
context:
space:
mode:
Diffstat (limited to 'upload.sh')
-rwxr-xr-xupload.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/upload.sh b/upload.sh
new file mode 100755
index 0000000..9fdbea6
--- /dev/null
+++ b/upload.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+shopt -s extglob
+
+if [[ "$1" != '' ]]; then
+ cd $1
+fi
+
+echo "Start upload: $(date)"
+echo
+
+for i in *.zip; do
+ echo "Uploading $i"
+ curl 'http://cmp.compromyse.xyz/jury/import-export' \
+ -X POST \
+ -H "Cookie: PHPSESSID=$2" \
+ -F 'problem_upload[contest]=' \
+ -F "problem_upload[archive]=@$i" \
+ -F 'problem_upload[upload]='
+done
+
+echo
+echo "End upload: $(date)"