]> git.xolatile.top Git - emil-xolatile.top.git/commitdiff
chud_upload.sh
authorEmil Williams <emilemilemil@cock.li>
Sun, 10 Aug 2025 20:05:28 +0000 (20:05 +0000)
committerEmil Williams <emilemilemil@cock.li>
Sun, 10 Aug 2025 20:05:28 +0000 (20:05 +0000)
files/chud_upload.sh [new file with mode: 0644]

diff --git a/files/chud_upload.sh b/files/chud_upload.sh
new file mode 100644 (file)
index 0000000..6c49c56
--- /dev/null
@@ -0,0 +1,12 @@
+# . /path/o/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
+}
+chud(){ upload "https://up.chud.cyou" "$@" ; }