File: /opt/aphex/backups/upload.sh
#!/bin/bash
# Exit if No File is Specified
if [[ "$#" == '0' ]]; then
echo -e 'ERROR: No File Specified!' && exit 1
fi
# File to Upload
FILE="@$1"
# Find the Best server to upload
SERVER=$(curl -s https://api.gofile.io/getServer | jq -r ".data|.server")
UPLOAD=$(curl -F token=SsCwurroDlY72S98yUVgFIKyzvOa5nAJ -F folderId=093a105b-47be-4378-9e4b-8382ee9673d1 -F file=${FILE} -s https://${SERVER}.gofile.io/uploadFile)
LINK=$(echo $UPLOAD | jq -r ".data|.downloadPage")
# Print the link!
echo $LINK
echo " "