From 45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Fri, 20 Sep 2024 14:16:56 +0200 Subject: Change dotfiles structure, and add guix-channels declaration. --- files/.bin/file_upload.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 files/.bin/file_upload.sh (limited to 'files/.bin/file_upload.sh') 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 @@ +#!/bin/sh + +BOLD="\e[1"; +ENDCOLOR="\e[0m"; +Green="32m"; +LightRed="31m"; + +echo "" +echo -e $BOLD";"";"$Green" FILE UPLOADER"$ENDCOLOR +echo "" + +if ! [ $1 ]; then + echo "" + echo -e $BOLD";"";"$LightRed" Please provide file path!"$ENDCOLOR + echo "" + exit +fi + +if [ $1 ]; then + echo -e " Are u sure u want upload this file: "$BOLD";"";"$Green" '$1'"$ENDCOLOR"? [y/N]: " + read -p " " input + echo "" + # read -r -p " " input + case $input in + [yY][eE][sS]|[yY]) + URL=$(curl -s -F "file=@$1" https://0x0.st); + echo -e " URL: "$BOLD";"";"$Green"$URL"$ENDCOLOR; + ;; + [nN][oO]|[nN]) + echo -e $BOLD";"";"$Green" OK"$ENDCOLOR; + ;; + *) + echo -e $BOLD";"";"$LightRed" Invalid input..."$ENDCOLOR; + exit 1 + ;; + esac + echo "" +fi; -- cgit v1.2.3