From b4106f07183471c187ebd7d47e3eaa2e13c1ea9c Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Mon, 23 Oct 2023 18:58:46 +0530 Subject: [PATCH] feat: upload to dl.mcaptcha.org --- upload.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 upload.sh diff --git a/upload.sh b/upload.sh new file mode 100755 index 0000000..edb04aa --- /dev/null +++ b/upload.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +set -xEeuo pipefail +readonly UPLOAD_DIR="cli/master" +readonly DUMBSERVE_HOST="https://$DUMBSERVE_USERNAME:$DUMBSERVE_PASSWORD@dl.mcaptcha.org" + + +curl --location --request DELETE "$DUMBSERVE_HOST/api/v1/files/delete" \ + --header 'Content-Type: application/json' \ + --data-raw "{ + \"path\": \"$UPLOAD_DIR\" + }" + + +pushd dist/ +for file in * +do + curl -v \ + -F upload=@$file \ + "$DUMBSERVE_HOST/api/v1/files/upload?path=$UPLOAD_DIR" +done +popd