forked from Sushrut1101/Recovery-Builder-Old
-
Notifications
You must be signed in to change notification settings - Fork 4
/
upload.sh
34 lines (25 loc) · 830 Bytes
/
upload.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# Change to the Source Directory
cd $SYNC_PATH
# Display a message
echo "============================"
echo "Uploading the Build..."
echo "============================"
# Change to the Output Directory
cd out/target/product/${DEVICE}
# List the Files
echo "Files inside ${SYNC_PATH}/out/target/product/${DEVICE} are:"
ls --color=auto
# Set FILENAME var
FILENAME=$(echo $OUTPUT)
# Upload to oshi.at
if [ -z "$TIMEOUT" ];then
TIMEOUT=20160
fi
curl -T $FILENAME https://oshi.at/${FILENAME}/${TIMEOUT} | tee link.txt > /dev/null || { echo "ERROR: Failed to Upload the Build!" && exit 1; }
# Show the Download Link
echo "=============================================="
cat link.txt || { echo "ERROR: Failed to Upload the Build!" && exit 1; }
echo "=============================================="
# Exit
exit 0