2019-11-27 18:17:32 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# assumes cross-compile.sh has already been run successfully
|
2019-11-28 15:03:32 +00:00
|
|
|
uploadFile()
|
|
|
|
{
|
|
|
|
FILE=$1
|
2019-11-27 18:17:32 +00:00
|
|
|
BASENAME="$(basename "${FILE}")"
|
2020-11-06 02:15:50 +00:00
|
|
|
|
2020-11-03 00:54:59 +00:00
|
|
|
# get available server from gofile api
|
2020-11-06 02:15:50 +00:00
|
|
|
serverApi=$(curl -m 15 https://apiv2.gofile.io/getServer)
|
|
|
|
resp=$(echo "$serverApi" | cut -d "\"" -f 4)
|
|
|
|
|
|
|
|
# if no server is available abort
|
|
|
|
if [ $resp != "ok" ] ; then
|
|
|
|
echo "Upload of $BASENAME failed! Server not available."
|
|
|
|
echo
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
server=$(echo "$serverApi" | cut -d "," -f 2 | cut -d "\"" -f 6)
|
|
|
|
|
2020-02-06 19:39:08 +00:00
|
|
|
# abort if it takes more than two minutes to upload
|
2020-11-03 00:54:59 +00:00
|
|
|
uploadedTo=$(curl -m 120 -F "email=stash@stashapp.cc" -F "file=@$FILE" "https://$server.gofile.io/uploadFile")
|
|
|
|
resp=$(echo "$uploadedTo" | cut -d "\"" -f 4)
|
|
|
|
if [ $resp = "ok" ] ; then
|
|
|
|
URL=$(echo "$uploadedTo"|cut -d "," -f 2 | cut -d "\"" -f 6)
|
|
|
|
echo "$BASENAME uploaded to url: \"https://gofile.io/d/$URL\""
|
|
|
|
fi
|
|
|
|
# print an extra newline
|
|
|
|
echo
|
|
|
|
|
2019-11-27 18:17:32 +00:00
|
|
|
}
|
|
|
|
|
2019-11-28 15:03:32 +00:00
|
|
|
uploadFile "dist/stash-osx"
|
|
|
|
uploadFile "dist/stash-win.exe"
|
2020-02-06 19:39:08 +00:00
|
|
|
uploadFile "dist/stash-linux"
|
2021-02-03 22:41:05 +00:00
|
|
|
|
|
|
|
echo "SHA1 Checksums"
|
|
|
|
cat CHECKSUMS_SHA1 | grep -v '\-pi\|\-arm'
|