-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path0ox.sh
executable file
·42 lines (35 loc) · 954 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
41
42
#!/bin/bash
if cat /etc/os-release | grep -i "ID_LIKE" | grep -i "arch"; then
sudo pacman -Syy --noconfirm qrencode curl zenity
elif cat /etc/os-release | grep -i "ID_LIKE" | grep -i "debian"; then
sudo apt-get update
sudo apt-get install -y curl qrencode zenity
fi
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
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