-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathupload.sh
More file actions
64 lines (55 loc) · 1.79 KB
/
upload.sh
File metadata and controls
64 lines (55 loc) · 1.79 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
#
# Upload Files
#
echo " "
echo "[1] Github Release [gh auth login]
[2] Devuploads [Key]
[3] pixeldrain [Key]
[4] Temp.sh
[5] Gofile
[6] oshi.at
[7] Sourceforge [Key]
"
read -p "Please enter your number: " UP
read -p "Please enter file path/name: " FP
read_secret() {
echo -n "$1"; KEY=""; while IFS= read -r -s -n1 c; do [[ $c == $'\n' || $c == $'\0' ]] && echo && break; [[ $c == $'\177' ]] && KEY="${KEY%?}" && echo -ne "\b \b" || { KEY+="$c"; echo -n "*"; }; done
}
if [ $UP == 1 ]; then
read -p "Please enter github repo link: " GH
FN="$(basename $FP)" && FN="${FN%%.*}"
echo -e "Started uploading file on github..."
gh release create $FN --generate-notes --repo $GH
gh release upload --clobber $FN $FP --repo $GH
fi
if [ $UP == 2 ]; then
read_secret "Please enter devupload key: "
echo "Started uploading file on DevUploads..."
bash <(curl -s https://devuploads.com/upload.sh) -f $FP -k "$KEY"
fi
if [ $UP == 3 ]; then
read_secret "Please enter Pixel Drain key: "
echo "Started uploading file on PixelDrain..."
curl -T $FP -u ":$KEY" https://pixeldrain.com/api/file/
fi
if [ $UP == 4 ]; then
echo -e "Started uploading file on Temp..."
curl -T $FP temp.sh
fi
if [ $UP == 5 ]; then
echo -e "Started uploading file on Gofile..."
SERVER=$(curl -X GET 'https://api.gofile.io/servers' | grep -Po '(store*)[^"]*' | tail -n 1)
curl -X POST https://${SERVER}.gofile.io/contents/uploadfile -F "file=@$FP" | grep -Po '(https://gofile.io/d/)[^"]*'
fi
if [ $UP == 6 ]; then
echo -e "Started uploading file on Oshi.at..."
curl -T $FP https://oshi.at
fi
if [ $UP == 7 ]; then
echo -e "Started uploading file on Sourceforge..."
read -p "Please enter Username: " USER
read -p "Please enter upload location:
Note: Path after /home/frs/project/" UPL
scp $FP "$USER"@frs.sourceforge.net:/home/frs/project/$UPL
fi