forked from tellmeY18/0ox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0ox.sh
executable file
·41 lines (32 loc) · 827 Bytes
/
0ox.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
35
36
37
38
39
40
#Bash Script to share files via 0x0.st (https://0x0.st) and zenity to select files
#!/bin/bash
#Check if zenity is installed
if ! command -v zenity &> /dev/null
then
echo "zenity could not be found"
exit
fi
#
##Check if curl is installed
if ! command -v curl &> /dev/null
then
echo "curl could not be found"
exit
fi
if ! command -v qrencode &> /dev/null
then
echo "qrencode not installed, please install qrencode "
exit
fi
#Select file to upload
sudo apt install qrencode
FILE=$(zenity --file-selection --title="Select file to upload")
#Upload file
URL=$(curl -s -F "file=@$FILE" https://0x0.st)
#Copy URL to clipboard using wl-copy
echo $URL | wl-copy
#Show URL
zenity --info --text="URL copied to clipboard: $URL"
qrencode -s 9 -l H -o "/tmp/URL.png" "$URL"
#Open URL in browser
xdg-open URL.png