From 4a2304cdc5abe3226281359f091e0230104e599c Mon Sep 17 00:00:00 2001 From: Emil Williams Date: Sun, 10 Aug 2025 21:22:11 +0000 Subject: [PATCH] index --- files/chud_upload.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/files/chud_upload.sh b/files/chud_upload.sh index 6c49c56..7133bb0 100644 --- a/files/chud_upload.sh +++ b/files/chud_upload.sh @@ -1,12 +1,17 @@ -# . /path/o/chud_upload.sh +# . /path/chud_upload.sh # or inline in rc -upload(){ -url="$1" -shift -if [ -z "$@" ] ; then curl "$url" -F"file=@/dev/stdin"; fi -for i in "$@"; do -if [ "$i" = "-" ]; then i="/dev/stdin" ; fi -curl "$url" -F"file=@$i" -done +upload() { # provides multifile, clipboard, and stdin support + url="$1" + shift + if [ -z "$@" ] ; then curl "$url" -F"file=@/dev/stdin"; fi + for i in "$@"; do + if [ "$i" = "-" ]; then i="/dev/stdin" ; fi + x=$(curl -F"file=@$2" $1) + echo $x + echo $x | xclip -sel c -i 2&>1 /dev/null + done } -chud(){ upload "https://up.chud.cyou" "$@" ; } + +chud() { upload 'https://up.chud.cyou' "$@" ; } +0x0 () { upload 'https://0x0.st' "$@" ; } +lainsafe () { upload 'https://lainsafe.kalli.st' "$@" ; } -- 2.39.5