summaryrefslogtreecommitdiffstats
path: root/.bin/file_upload.sh
diff options
context:
space:
mode:
authorjdlugosz963 <jdlugosz963@gmail.com>2022-12-28 16:16:57 +0100
committerjdlugosz963 <jdlugosz963@gmail.com>2022-12-28 16:16:57 +0100
commit23a70dc3ece576344603c67ac219b524f7086bca (patch)
tree9703cd58012c7f69903627e6bb6577c7d0b844cb /.bin/file_upload.sh
parentaaf735839cdd308dd2a4f89b6f85d482c970710e (diff)
downloaddotfiles-23a70dc3ece576344603c67ac219b524f7086bca.tar.gz
dotfiles-23a70dc3ece576344603c67ac219b524f7086bca.zip
Add custom scripts to bin folder
Diffstat (limited to '.bin/file_upload.sh')
-rwxr-xr-x.bin/file_upload.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/.bin/file_upload.sh b/.bin/file_upload.sh
new file mode 100755
index 0000000..0ff6c57
--- /dev/null
+++ b/.bin/file_upload.sh
@@ -0,0 +1,38 @@
1#!/bin/sh
2
3BOLD="\e[1";
4ENDCOLOR="\e[0m";
5Green="32m";
6LightRed="31m";
7
8echo ""
9echo -e $BOLD";"";"$Green" FILE UPLOADER"$ENDCOLOR
10echo ""
11
12if ! [ $1 ]; then
13 echo ""
14 echo -e $BOLD";"";"$LightRed" Please provide file path!"$ENDCOLOR
15 echo ""
16 exit
17fi
18
19if [ $1 ]; then
20 echo -e " Are u sure u want upload this file: "$BOLD";"";"$Green" '$1'"$ENDCOLOR"? [y/N]: "
21 read -p " " input
22 echo ""
23 # read -r -p " " input
24 case $input in
25 [yY][eE][sS]|[yY])
26 URL=$(curl -s -F "file=@$1" https://0x0.st);
27 echo -e " URL: "$BOLD";"";"$Green"$URL"$ENDCOLOR;
28 ;;
29 [nN][oO]|[nN])
30 echo -e $BOLD";"";"$Green" OK"$ENDCOLOR;
31 ;;
32 *)
33 echo -e $BOLD";"";"$LightRed" Invalid input..."$ENDCOLOR;
34 exit 1
35 ;;
36 esac
37 echo ""
38fi;