diff options
| author | jdlugosz963 <jdlugosz963@gmail.com> | 2024-09-20 14:16:56 +0200 |
|---|---|---|
| committer | jdlugosz963 <jdlugosz963@gmail.com> | 2024-09-20 14:16:56 +0200 |
| commit | 45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a (patch) | |
| tree | b564c1c43920def6641cd482a7b4dca453dbc043 /files/.bin/file_upload.sh | |
| parent | 07dd8e37eb767c3dd6abf63e5e4a720cd778da15 (diff) | |
| download | dotfiles-45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a.tar.gz dotfiles-45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a.zip | |
Change dotfiles structure, and add guix-channels declaration.
Diffstat (limited to 'files/.bin/file_upload.sh')
| -rwxr-xr-x | files/.bin/file_upload.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/files/.bin/file_upload.sh b/files/.bin/file_upload.sh new file mode 100755 index 0000000..0ff6c57 --- /dev/null +++ b/files/.bin/file_upload.sh | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | BOLD="\e[1"; | ||
| 4 | ENDCOLOR="\e[0m"; | ||
| 5 | Green="32m"; | ||
| 6 | LightRed="31m"; | ||
| 7 | |||
| 8 | echo "" | ||
| 9 | echo -e $BOLD";"";"$Green" FILE UPLOADER"$ENDCOLOR | ||
| 10 | echo "" | ||
| 11 | |||
| 12 | if ! [ $1 ]; then | ||
| 13 | echo "" | ||
| 14 | echo -e $BOLD";"";"$LightRed" Please provide file path!"$ENDCOLOR | ||
| 15 | echo "" | ||
| 16 | exit | ||
| 17 | fi | ||
| 18 | |||
| 19 | if [ $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 "" | ||
| 38 | fi; | ||
